7

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?

4

1 Answer 1

16

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}

Output

enter image description hereenter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .