4

I would like to fill a circle at the end of a line with an angle. When I try to do it by simply setting the node to "fill", the whole line is filled. I was wondering how to only fill the circle. This is what I have for now:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}
    \draw[black, thick] (0,0) node[above,red]{Min} -- (8,0) node[above,red]{Max};
    \draw[red, fill=red] (0,0) circle(2pt);
    \draw[red, fill=red] (8,0) circle(2pt);

    \draw[red, thick] (0.02,0) |- (8,-0.6) circle(2pt)[fill] node[right]{some};
    \draw[red, thick] (0,0) |- (0,-0.9) circle(2pt) node[right]{none};
    \draw[red, thick] (8,0) |- (8,-0.3) circle(2pt) node[right]{all};
\end{tikzpicture}

\end{document}

It looks like this:

Not right at all!

The red triangle effect is unintentional.

3

Alternative method using nodes to make the circles and dots.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}[
    circ/.style={draw,circle,inner sep=0pt,minimum size=4pt},
    dot/.style={circ,fill}
    ]
    \draw[black, thick] (0,0) node[above,red]{Min} -- (8,0) node[above,red]{Max};
    \draw[red] (0,0) node[dot]{};
    \draw[red] (8,0) node[dot]{};

    \draw[red, thick] (0.02,0) |- (8,-0.6) node[dot]{} node[right]{some};
    \draw[red, thick] (0,0) |- (0,-0.9) node[circ]{} node[right]{none};
    \draw[red, thick] (8,0) |- (8,-0.3) node[circ]{} node[right]{all};
\end{tikzpicture}

\end{document}
1

You could write the fill command in a second line.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}
    \draw[black, thick] (0,0) node[above,red]{Min} -- (8,0) node[above,red]{Max};
    \draw[red, fill=red] (0,0) circle(2pt);
    \draw[red, fill=red] (8,0) circle(2pt);

    \draw[red,thick] (0.02,0) |- (8,-0.6);
    \fill[red] (8,-0.6) circle(2pt) node[right]{some};
    \draw[red, thick] (0,0) |- (0,-0.9) circle(2pt) node[right]{none};
    \draw[red, thick] (8,0) |- (8,-0.3) circle(2pt) node[right]{all};
\end{tikzpicture}

\end{document}

enter image description here

1

The path (0.02,0) |- (8,-0.6) is essentially composed of two paths; one vertical and another horizontal. If you break it into two open paths, then the only remaining closed path will be the circle and it will be filled correctly. There exist other (may be better) options to place these nodes, though.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}
    \draw[thick] (0,0) node[above,red]{Min} -- (8,0) node[above,red]{Max};
    \draw[red,fill] (0,0) circle(2pt);
    \draw[red,fill] (8,0) circle(2pt);

    \draw[red,thick] (.02,0)--(.02,-.6) (.02,-.6)--(8,-.6) circle(2pt)[fill] node[right]{some};
    \draw[red,thick] (0,0) |- (0,-0.9) circle(2pt) node[right]{none};
    \draw[red,thick] (8,0) |- (8,-0.3) circle(2pt) node[right]{all};
\end{tikzpicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.