How to change the weight of a pin line in PGF Plots?

Using pins is a nice way to annote your plots in PGF Plots. However, I would like to have the weight for the line leading from a point on the graph to the text to be bold. How do I do this?

Consider the following MWE:

\documentclass{minimal}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5.1}

\begin{document}
\begin{tikzpicture}
\begin{axis}
{exp(x)};
54.59815
\node[coordinate,pin=left:{A pin!}]
at (axis cs:4,54.59815) {};
\end{axis}
\end{tikzpicture}
\end{document}


To modify a single pin, you can use pin edge:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5.1}

\begin{document}
\begin{tikzpicture}
\begin{axis}
{exp(x)};
54.59815
\node[coordinate,pin={[pin edge={blue,ultra thick}]left:{A pin!} } ]
at (axis cs:4,54.59815) {};
\end{axis}
\end{tikzpicture}
\end{document}


To change the format for all pins, you can change the every pin edge style.

• Fantastic, thanks! May I ask two questions? 1. How did you find this out? I am still learning TikZ and have trouble finding such information. At least I was too blind to see it in the manual, if it is in there. 2. Could I add an arrow tip to the pin? Thanks again!
– Ingo
May 30 '12 at 7:17
• @Ingo You're welcome! Regarding your questions: 1. pages 196 and 197 of the pgfmanual contain basic information about pins; in particular, pin edge and every pin edge. 2. Of course, you can use the arrow syntax for pin edge: you can use something like \node[coordinate,pin={[pin edge={<-,blue,ultra thick}]left:{A pin!} } ] in the code above. May 30 '12 at 13:46
• Just to add, if you want this style to apply to all pin use: \tikzset{ every pin edge/.append style={blue, thick} } Oct 10 '13 at 6:50
• What are the options available for the size, thick, ultra thick, ...?
– Ribz
Jun 29 '17 at 16:06