有腿的圆圈 - 节点锚点不足

有腿的圆圈 - 节点锚点不足

我需要画一个有 n 条腿的圆和一个有 n+2 条腿的圆。通常我会用锚点将腿连接到圆上。但是北、东北、西北等……简单还不够。看起来很奇怪……

我该怎么做才能让它看起来更好?

\documentclass[utf8]{article} 
\usepackage{tikz} %For Drawing with pdflatex
\usetikzlibrary{decorations.markings} % For Arrow heads in the middle
\usetikzlibrary{decorations.text} % For text along path 
\usetikzlibrary{positioning} % For relative positioning
\usetikzlibrary{backgrounds} % For background layer
\usetikzlibrary{fit} % To make background fit
\usetikzlibrary{calc} % To calculate e.g. the distance between nodes
\usetikzlibrary{shapes} % more shapes   
\begin{figure}[h]
\centering
\resizebox{0.8 \linewidth}{!}{
\begin{tikzpicture}
\node[draw,circle, minimum size=1cm] (c1) {1L};
\node [above right=.5cm of c1.north east] (l1c1) {\tiny 1} 
edge [thick] node [] {} (c1.north east) ;
\node [above left=.5cm of c1.north west] (lnc1) {\tiny n} 
edge [thick] node [] {} (c1.north west) ;
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c1) circle (.7cm) ;
%
\node [right =.2cm of c1.east] (eq) {=} ;
%
\node[right=.2cm of eq.east,draw,circle, minimum size=1cm] (c2) {0L};
\node [above right=.5cm of c2.north east] (l1c2) {\tiny 1} 
edge [thick] node [] {} (c2.north east) ;
\node [above left=.5cm of c2.north west] (lnc2) {\tiny n} 
edge [thick] node [] {} (c2.north west) ;
\node [above left=.5cm of c2.north] (ll1c2) {\tiny $l_1$} 
edge [thick] node [] {} (c2.north) ;
\node [above right=.5cm of c2.north] (ll2c2) {\tiny $l_2$} 
edge [thick] node [] {} (c2.north) ;
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c2) circle (.7cm) ;

\end{tikzpicture}
}
\caption{The Ansatz for $A_n^+$}
\label{fig:nap}
\end{figure}

我的尝试:

在此处输入图片描述

答案1

您无需使用northnorth west等等,只需在节点名称后面输入角度(度)。例如(c2.95);在您的示例中。锚点east等于 0 度。角度按逆时针方向定义。

% arara: pdflatex

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.text}

\begin{document}
\begin{figure}[h]
\centering
\resizebox{0.8 \linewidth}{!}{
\begin{tikzpicture}
\node[draw,circle, minimum size=1cm] (c1) {1L};
\node [above right=.5cm of c1.north east] (l1c1) {\tiny 1} 
edge [thick] node [] {} (c1.north east) ;
\node [above left=.5cm of c1.north west] (lnc1) {\tiny n} 
edge [thick] node [] {} (c1.north west) ;
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c1) circle (.7cm) ;
%
\node [right =.2cm of c1.east] (eq) {=} ;
%
\node[right=.2cm of eq.east,draw,circle, minimum size=1cm] (c2) {0L};
\node [above right=.5cm of c2.north east] (l1c2) {\tiny 1} 
edge [thick] node [] {} (c2.north east) ;
\node [above left=.5cm of c2.north west] (lnc2) {\tiny n} 
edge [thick] node [] {} (c2.north west) ;
\node [above left=.5cm of c2.north] (ll1c2) {\tiny $l_1$} 
edge [thick] node [] {} (c2.95); % adapt angle to your needs!
\node [above right=.5cm of c2.north] (ll2c2) {\tiny $l_2$} 
edge [thick] node [] {} (c2.85); % adapt angle to your needs!
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c2) circle (.7cm) ;

\end{tikzpicture}
}
\caption{The Ansatz for $A_n^+$}
\label{fig:nap}
\end{figure}
\end{document}

在此处输入图片描述

第二种可能性是手动移动锚点。虽然不是很美观,但在某些情况下还是不错的(对于圆形节点来说不是那么好......)。这可能看起来像edge [thick] node [] {} ([xshift=-1.4mm, yshift=-3mm]c1.north west);

第三种可能性是定义线的起点和角度,并借助计算终点\usetikzlibrary{calc,intersections}。但我想这有点太多了。您可以在侧面搜索有关此方面的示例。

相关内容