[Tex/LaTex] TikZ: small circle as an arrow tip

tikz-pgf

I know that the TikZ Arrow Tip Library (arrows) defines a circle arrow [-o], however this circle is too large for me. Is there any way I can control the size of the circle on the end of line?

Best Answer

You can use the decorations.markings library to define a style (say, o) that takes an optional argument for changing the size:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}

\tikzset{
    o/.style={
        shorten >=#1,
        decoration={
            markings,
            mark={
                at position 1
                with {
                    \draw circle [radius=#1];
                }
            }
        },
        postaction=decorate
    },
    o/.default=2pt
}
\begin{tikzpicture}    
\draw [o] (0,1) -- (4,3);
\draw [o=1pt] (1,1) -- (4,2);
\end{tikzpicture}
\end{document}