答案1
您可以只使用虚线。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\draw[dash pattern=on 2pt off 1cm-2pt,line width=2pt,dash phase=2pt]
(0,0) -| (2,6) -| cycle;
\draw[dash pattern=on 2pt off 3pt,line width=2pt]
(5,3) circle[radius=5/pi];
\end{tikzpicture}
\caption{A caption.}
\end{figure}
\end{document}