# How can I change the line width of the spy-on node in tikz spy library?

is there an option to change the line width of the spy-on node, i.e. the node that appears on the image, in the tikz spy library?

• – Qrrbrbirlbel Nov 19 '13 at 18:21
• I tried that already in every possible way, but spy seems to ignore it. For example \spy[blue] paints the line blue, but \spy[thick] has no effect. – Martin Nov 19 '13 at 18:54
• This is quite a hack tex.stackexchange.com/questions/55374/…. I would suggest get over it and stay away. It's not worth it:) – percusse Nov 19 '13 at 20:29
• Whoa I got the question completely wrong – percusse Nov 19 '13 at 22:24

You can’t use \spy[thick] because

1. the options of \spy are actually used on a scope and
2. the every spy on node style includes already very thin (.2pt) which overwrites the thick of the scope from \spy.

You will need to use the every spy on node style and alter it. For every spy in the current scope you can use it in spy using outlines, e.g.

spy using outlines={…, every spy on node/.append style={thin}}


or directly on the \spy with

\spy [every spy on node/.append style={ultra thick}] …;


## Code

\documentclass[tikz]{standalone}
\usetikzlibrary{spy,decorations.fractals}
\begin{document}
\begin{tikzpicture}[
spy using outlines={circle, magnification=4, size=2cm, connect spies,
every spy on node/.append style={thin}}]
\draw [decoration={name=Koch curve type 1}] decorate
{ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}};
\spy [red]            on (1.6,0.3) in node [left]  at (3.5,-1.25);
\spy [blue, size=1cm] on (  1,  1) in node [right] at (  0,-1.25);
\end{tikzpicture}
\begin{tikzpicture}[
spy using outlines={circle, magnification=4, size=2cm, connect spies}]
\draw [decoration={name=Koch curve type 1}] decorate
{ decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}};
\spy [red, every spy on node/.append style={ultra thick}]
on (1.6,0.3) in node [left]  at (3.5,-1.25);
\spy [blue, size=1cm]
on (  1,  1) in node [right] at (  0,-1.25);
\end{tikzpicture}
\end{document}