1

I'm using the tikz package to create diagrams showing the formation process of simple fractals, the first one being is the Cantor set. I'm showing a couple of iterations each one below the previous with its corresponding label at the side and then a larger space before the final fractal set, along with some vertical dots between the label. This is my current code

\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}

My issue is that I'm unsure of how to make it so that the labels are aligned. An ideal answer would be one that would require minimal changes when applied fractal figures where the vertical spacing will be different. Thanks in advance!

6
  • 1
    Please provide a MWE (Minimal Working Example) for us to test and work on. As is, we don't know what decoration=Cantor set is, for example.
    – Alenanno
    Commented Jan 17, 2018 at 22:09
  • Apologies, I forgot to copy the whole thing in. It's been edited now.
    – M. Hughes
    Commented Jan 17, 2018 at 22:18
  • @M.Hughes, how should be aligned. your mwe gives well aligned labels.
    – Zarko
    Commented Jan 17, 2018 at 22:19
  • @Zarko They are currently left aligned but I'd like them centre aligned
    – M. Hughes
    Commented Jan 17, 2018 at 22:20
  • I should have been clearer, I mean rather than the dots are aligned with the other labels.
    – M. Hughes
    Commented Jan 17, 2018 at 22:26

1 Answer 1

1

since question is not clear (to me), let helps us with following picture:

enter image description here

is this, what you looking for?

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .