Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage{geometry}
- \usepackage{subcaption}
- \usepackage{tikz}
- \tikzset{%
- pics/staircase/.style={code={
- \draw[mydash] (-0.5*#1,-0.5*#1) -| (0.5*#1,0.5*#1);
- \foreach \XX in {1,...,#1}
- {\draw[mydash] (-0.5*#1+\XX-1,-0.5*#1+\XX-1) |- ++ (1,1);
- \ifnum\XX<#1
- \draw[mydash,red] (-0.5*#1+\XX,-0.5*#1) -- ++ (0,\XX);
- \draw[mydash,blue] (0.5*#1,0.5*#1-\XX) -- ++ (-\XX,0);
- \fi}}},mydash/.style={thick,shorten <=1mm,dash pattern=on 8mm off 2mm}
- }
- \newcommand{\staircase}[1]{%
- \begin{tikzpicture}
- \path (0,0) pic{staircase=#1} (0,1);
- \end{tikzpicture}
- }
- \begin{document}
- \begin{figure}[!h]
- \centering
- \begin{subfigure}[b]{0.09\textwidth}
- \centering
- \staircase{1}
- \caption*{$F_1$}
- \end{subfigure}
- \begin{subfigure}[b]{0.19\textwidth}
- \centering
- \staircase{2}
- \caption*{$F_2$}
- \end{subfigure}
- \begin{subfigure}[b]{0.29\textwidth}
- \centering
- \staircase{3}
- \caption*{$F_3$}
- \end{subfigure}
- \begin{subfigure}[b]{0.39\textwidth}
- \centering
- \staircase{4}
- \caption*{$F_4$}
- \end{subfigure}
- \caption{}
- \end{figure}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement