Is it possible to place a shadow/fill/opaque setting on text of a node pin? I know I can do that with the actual node, but I am using \node in pgfplots to mark some stuff on graphs, and it would be great if I could make a white filling in the text area to make it more clear. Of course, if you know a better way to achieve the same thing in pgf, let me know.

Code I've got so far is below. I tried putting something like [opaque=0.5] after pin, but it seems it has no such options, and I wasn't able to find anything relevant to pin text in pgf documentation.

\tikzset{small dot/.style={fill=black,

\node[small dot, pin=120:{$100\ k\Omega$}] at (axis description cs:0.5,0.61) {};
  • Did you try opacity=0.5? – Peter Grill Jan 11 '12 at 0:08

To get a semi-transparent background for your pin (or any other node, for that matter), you first need to specify some fill colour. So to get a semi-opaque node background, you could set fill=white, fill opacity=0.5, text opacity=1. Note that the text opacity needs to be set separately, since fill opacity applies both to the background colour and the text.


    grid=both, minor tick num=3, grid style=gray % Darker grid than normal to show the effect better
\node[pin={[fill=white, fill opacity=0.5, text opacity=1]120:$100\ k\Omega$}] at (axis description cs:0.5,0.6) {};

I have been using \tikzset{every pin/.style={draw=black,fill=yellow!10}} which yields:

enter image description here




\tikzset{small dot/.style={fill=black, circle,scale=0.2}}
\tikzset{every pin/.style={draw=black,fill=yellow!10}}

\node[small dot, pin=120:{$100\ k\omega$}] at (axis description cs:0.5,0.61) {};
  • This is a really great idea. – henry Jun 7 '14 at 11:48

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.