pgf 手册对此并没有明确说明,所以我来这里向堆栈社区询问。我尝试在 spyonnode 周围添加一些阴影/模糊效果,但完全没有效果!
我尝试了这个:
\begin{tikzpicture}[spy using overlays={
circle,
magnification=2,
size=1.5cm,
connect spies,
Ggray1
}
]
...
\spy[circular drop shadow,
spy connection path={
\draw[thick] (tikzspyonnode) -- (tikzspyinnode);
}
] on (spypoint) in node at (3.25,-1.35);
\end{tikzpicture}
有人有想法吗?
答案1
你可以用第 49.5 节中给出的示例来定义你自己的间谍风格PGF/TikZ
手册。下面就是一个带有阴影间谍窗口的修改。
\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{spy,shadows}
\tikzset{spy using overlaysshadow/.style={
spy scope={#1,
every spy on node/.style={
circle,
fill, fill opacity=0.2, text opacity=1
},
every spy in node/.style={
circle, circular drop shadow,
fill=white, draw, ultra thick, cap=round
}
}
}
}
\begin{document}
\begin{tikzpicture}[spy using overlaysshadow={
magnification=3,
size=1.5cm,
connect spies}
]
\begin{axis}
\addplot3[surf,shader=faceted,
samples=25,domain=0:2,y domain=0:1]
{exp(-x) * sin(pi*deg(y))};
\begin{scope}
\spy [red] on (2,3cm) in node at (3.5cm,-1.25cm);
\spy [blue,size=1cm] on (3cm,1cm) in node at (0,-1.25cm);
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}