I want to create a set of steps using a TikZ picture. I tried to use the positioning library to position the steps next to each other like this:

enter image description here

(Not for scale, the bottom edges should align)

So I did this:

  \node[draw, rectangle,             align=center, minimum height=2cm] (1) {\textbf{1} \\ Step};
  \node[draw, rectangle, right=of 1, align=center, minimum height=3cm] (2) {\textbf{2} \\ Step};
  \node[draw, rectangle, right=of 2, align=center, minimum height=4cm] (3) {\textbf{3} \\ Step};
  \node[draw, rectangle, right=of 3, align=center, minimum height=5cm] (4) {\textbf{4} \\ Step};
  \node[draw, rectangle, right=of 4, align=center, minimum height=6cm] (5) {\textbf{5} \\ Step};

But it looks like it aligns the node centers, instead of the bottom edges:

enter image description here

That's not step-like at all. How can I do that (without using at to position each node manually)?


enter image description here

\documentclass[tikz, margin=3mm]{standalone}

   box/.style = {rectangle, draw, minimum width=1cm,
                 minimum height=#1, align=center},
node distance = 0mm and 5mm
\node[box=2cm] (1) {\textbf{1} \\ Step};
\node[box=3cm, above right=of 1.south east] (2) {\textbf{2} \\ Step};
\node[box=4cm, above right=of 2.south east] (3) {\textbf{3} \\ Step};
\node[box=5cm, above right=of 3.south east] (4) {\textbf{4} \\ Step};
\node[box=6cm, above right=of 4.south east] (5) {\textbf{5} \\ Step};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.