在 tikz 间谍库中,是否有选项可以更改间谍节点(即出现在图像上的节点)的线宽?
答案1
你不能使用\spy[thick]
,因为
- 的选项
\spy
实际上是在范围内使用的,并且 - 该
every spy on node
样式已包含very thin
(.2pt
),它覆盖了thick
的范围\spy
。
您需要使用该every spy on node
样式并对其进行修改。对于当前范围内的每个间谍,您都可以使用它spy using outlines
,例如
spy using outlines={…, every spy on node/.append style={thin}}
或直接\spy
在
\spy [every spy on node/.append style={ultra thick}] …;
代码
\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}