我想制作一些集合并用指示线标记/命名它们。集合的边界应遵循一些坐标。我试图将这些红线移到最接近对象边界(或某个特定点)(一条线或节点)的位置。这是我的 MWE 和一张图片:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw plot [smooth cycle] coordinates {(0,0)(2,3)(7,2)(6,-3)(3,-4)(1,-1)} node (a) {};
\node [circle, left, label={[xshift=-1cm,yshift=-1cm]\large $\Omega$}] (b) at (a) {};
\node [style={circle,fill=gray!25,draw}, label={[xshift=1cm,yshift=-1cm]text}] (c) at (2,2) {};
\end{tikzpicture}
\end{document}
答案1
您追求的是pin
选项,而不是label
。
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw plot [smooth cycle] coordinates {(0,0)(2,3)(7,2)(6,-3)(3,-4)(1,-1)} coordinate [pin={[pin edge={red,thick}]below left:$\Omega$}] (a) {};
\node [style={circle,fill=gray!25,draw}, pin={[pin edge={red,thick}]below right:text}] (c) at (2,2) {};
\end{tikzpicture}
\end{document}