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?
-
Does Increase the thickness of node border in TikZ help?– QrrbrbirlbelNov 19, 2013 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.– MartinNov 19, 2013 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:)– percusseNov 19, 2013 at 20:29
-
Whoa I got the question completely wrong– percusseNov 19, 2013 at 22:24
1 Answer
You can’t use \spy[thick]
because
- the options of
\spy
are actually used on a scope and - the
every spy on node
style includes alreadyvery thin
(.2pt
) which overwrites thethick
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}