我正在使用 tikz 包创建图表来展示简单分形的形成过程,第一个是康托集。我展示了几个迭代,每个迭代都位于前一个迭代的下方,其对应的标签位于侧面,然后在最终分形集之前有一个更大的空间,标签之间有一些垂直点。这是我当前的代码
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{decorations.fractals}
\begin{tikzpicture}[xscale = 3.0, yscale=1, decoration=Cantor set,very thick]
\draw decorate{ (0,0) -- (3,0) };
\node at (3,0) [right] {$E_0$};
\node at (3,-1) [right] {$E_1$};
\node at (3,-2) [right] {$E_2$};
\node at (3,-3) [right] {$\vdots$};
\node at (3,-4) [right] {$F$};
\draw decorate{ decorate{ (0,-1) -- (3,-1) }};
\draw decorate{ decorate{ decorate{ (0,-2) -- (3,-2) }}};
\draw decorate{ decorate{ decorate{ decorate{ decorate{ decorate{ decorate{(0,-4) -- (3,-4) }}}}}}};
\end{tikzpicture}
\end{document}
我的问题是,我不确定如何让标签对齐。理想的答案是,当应用垂直间距不同的分形图形时,只需要进行最小的更改。提前致谢!
答案1
因为问题不清楚(对我来说),让我们用下面的图片来帮助我们:
这就是你要找的东西吗?
\documentclass[tikz, margin=3mm]{standalone}
\usepgflibrary{decorations.fractals}
\begin{document}
\begin{tikzpicture}[xscale = 3.0, yscale=1, decoration=Cantor set,very thick]
\draw decorate{(0,0) -- (3,0)} node[right] {$E_0$};
\draw decorate{ decorate{ (0,-1) -- (3,-1) }} node [right] {$E_1$};
\draw decorate{ decorate{ decorate{ (0,-2) -- (3,-2) }}} node[right] (e2) {$E_2$};
\draw decorate{ decorate{ decorate{ decorate{ decorate{ decorate{ decorate{(0,-4) -- (3,-4) }}}}}}} node [right] (f) {$F$};
\node at ($(e2)!0.5!(f)$) {$\vdots$};
\end{tikzpicture}
\end{document}