答案1
这是绘制椭圆的小起点(但不是文本和箭头)(我的第一个真正的 TikZ 答案 ;-))
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0cm,0cm) ellipse[x radius=1cm,y radius=0.5cm];
\draw (0cm,0.25cm) ellipse[x radius=1.5cm,y radius=0.75cm];
\draw (0cm,0.5cm) ellipse[x radius=2cm,y radius=1cm];
\draw (0cm,0.75cm) ellipse[x radius=2.5cm,y radius=1.25cm];
\end{tikzpicture}
\end{document}
答案2
还有一个基于节点和\foreach
循环使用的解决方案:
\documentclass[border=3mm,tikz]{standalone}
\usetikzlibrary{calc,positioning,shapes}
\begin{document}
\begin{tikzpicture}[
node distance = 0 mm and 33mm,
E/.style = {shape=ellipse, aspect=2,
minimum height=#1mm,
minimum width=16mm+#1mm,
draw, anchor=south,
node contents={}}
]
\foreach \i in {1,2,...,5}
\node (n\i) [E={7+\i*5}];
\foreach \i [count=\ix from 1] in {RL,KL,CFL,CSL,REL}
\node (m\ix) minimum width=3em,below=of n\ix.north] {\i};
\foreach \i [count=\ix from 1] in {NFA,KA,PDA,LBA,TM}
{
\node (l\ix) [right=of m\ix.south east] {\i};
\draw[shorten <=4mm,->] (m\ix.south east) -- (l\ix);
}
\end{tikzpicture}
\end{document}
编辑:改进标签的位置。现在所有箭头的长度都相等,并且右侧的标签从相同的“x”位置开始。
答案3
你可以从这里开始:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,calc}
\begin{document}
\begin{tikzpicture}[
thick, scale=0.5]
%\draw [help lines] (-3,-3) grid (3,3);
\draw (0,1) ellipse(4 and 2) node(A){A};
\node (cA) at (10,1) {comment A};
\draw [->] (A) -- (cA);
\draw (0,2) ellipse(6 and 3) (0,4) node{B};
\end{tikzpicture}
\end{document}
您也可以尝试
\draw [->, shorten <=1cm, shorten >=0.3cm] (A) -- (cA);
对于箭头。