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?
Asked
Active
Viewed 3,080 times
7
-
Does Increase the thickness of node border in TikZ help? – 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 http://tex.stackexchange.com/questions/55374/change-draw-color-in-a-clipped-region-in-tikz-pgf. 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
1 Answers
16
You can’t use \spy[thick] because
- the options of
\spyare actually used on a scope and - the
every spy on nodestyle includes alreadyvery thin(.2pt) which overwrites thethickof 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}
Output


Qrrbrbirlbel
- 119,821