如何添加 tikz 弯曲箭头来连接图片上的特定点?

如何添加 tikz 弯曲箭头来连接图片上的特定点?

我想逐步将连接箭头添加到图片中。到目前为止,我有一个手动定位的直箭头,例如,从的图形。

如何在图片中添加更直观坐标的弯曲箭头?谢谢!

\documentclass[t,aspectratio=169]{beamer}
\usetheme{metropolis}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\begin{frame}[c,plain]
\frametitle{New}

\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center)  {\includegraphics[width=0.4\textwidth]{example-image}};
\draw<2->[thick, -latex, red] (8,1) to (7,2) to (6,1);
\end{tikzpicture}


\end{frame}%

\end{document}

图。1

图2

答案1

以下是弯曲箭头的几种方法:

1 使用rounded corners选项

\documentclass[t,aspectratio=169]{beamer}
\usetheme{metropolis}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\begin{frame}[c,plain]
\frametitle{New}

\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center)  {\includegraphics[width=0.4\textwidth]{example-image}};
\draw<2->[thick, -latex, red,rounded corners=5mm] (8,1) to (7,2) to (6,1);
\end{tikzpicture}


\end{frame}%

\end{document}

示例 1

2 使用Curve-To Operation

\documentclass[t,aspectratio=169]{beamer}
\usetheme{metropolis}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\begin{frame}[c,plain]
\frametitle{New}

\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center)  {\includegraphics[width=0.4\textwidth]{example-image}};
\draw<2->[thick, -latex, red] (8,1) to[out=80,in=50] (6,1);
\end{tikzpicture}


\end{frame}%

\end{document}

示例 2

3 使用Curve-To style(贝塞尔曲线)

\documentclass[t,aspectratio=169]{beamer}
\usetheme{metropolis}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\begin{frame}[c,plain]
\frametitle{New}

\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center)  {\includegraphics[width=0.4\textwidth]{example-image}};
\draw<2->[thick, -latex, red] (8,1) to [controls=+(70:1) and +(40:2)] (6,1);
\end{tikzpicture}


\end{frame}%

\end{document}

示例 3

4 带有选项bend left

\documentclass[t,aspectratio=169]{beamer}
\usetheme{metropolis}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\begin{frame}[c,plain]
\frametitle{New}

\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center)  {\includegraphics[width=0.4\textwidth]{example-image}};
\draw<2->[thick, -latex, red] (8,1) to [bend right=70] (6,1);
\end{tikzpicture}


\end{frame}%

\end{document}

示例 4

相关内容