Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
        \addplot[domain=1:6]
        {exp(x)};
        54.59815
        \node[coordinate,pin=left:{A pin!}]
            at (axis cs:4,54.59815) {};
    \end{axis}
\end{tikzpicture}
\end{document}
share|improve this question

1 Answer 1

up vote 9 down vote accepted

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}
        \addplot[domain=1:6]
        {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}

enter image description here

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

share|improve this answer
1  
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. –  Gonzalo Medina 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} } –  M.Reza Oct 10 '13 at 6:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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