答案1
您可以spy
在特定区域:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,spy}
\begin{document}
\begin{tikzpicture}
\begin{scope}[
node distance = 11mm,
inner sep = 0pt,spy using outlines={rectangle, red, magnification=6,
%connect spies
}
]
\node (n0) {\includegraphics[width=\textwidth]{example-image-a}};
\spy [blue,size=3cm] on (n0.center) in node[below right=of n0.north west];
\end{scope}
\draw[dashed,blue] (tikzspyonnode.north east) -- (tikzspyinnode.north east);
\draw[dashed,blue] (tikzspyonnode.south west) -- (tikzspyinnode.south west);
\end{tikzpicture}
\end{document}
适当调整size=3cm
和magnification=6
值。
答案2
当你将图形插入到节点中时,绘制它们之间的连接就很容易了:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[
node distance = 11mm,
inner sep = 0pt
]
\node (n0) {\includegraphics[width=\textwidth]{example-image}};
\node[at=(n0.center)] (n1)
{\includegraphics[width=0.1\textwidth]{example-image-a}};
\node[below right=of n0.north west] (n2)
{\includegraphics[width=0.3\textwidth]{example-image-b}};
\draw[densely dashed] (n2.north east) -- (n1.north east)
(n2.south west) -- (n1.south west);
\end{tikzpicture}
\caption{Galaxy}
\end{figure}
\end{document}
您只需通过节点锚点之间的线进行连接: