间谍放大镜形状

间谍放大镜形状

我正在尝试使用间谍图书馆但我希望放大镜用路径给出(例如六边形)。有可能吗?是否可以显示仅有的放大的部分?

以下是针对 pgfmanual 拍摄的 MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usetikzlibrary {decorations.fractals,spy}

\begin{document}
\begin{tikzpicture}[spy using overlays={size=12mm}]
\draw [decoration=Koch snowflake]
decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}};
\spy [blue,magnification=5] on (1,0.5) in node at (1,-1);
\end{tikzpicture}
\end{document}

答案1

您可以使用 TikZ 中的多边形节点形状shapes您可以像这样

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usetikzlibrary {decorations.fractals,spy, shapes}

\begin{document}
\begin{tikzpicture}[regular polygon, regular polygon sides=6, spy using overlays={size=12mm}]
\draw [decoration=Koch snowflake]
decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}};
\spy [blue,magnification=5] on (1,0.5) in node at (1,-1);
\end{tikzpicture}
\end{document}

六边形间谍形状

相关内容