Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[border=5mm]{standalone}
- usepackage{tikz}
- usetikzlibrary{calc}
- usetikzlibrary{backgrounds}
- usepackage{pgfplots}
- pgfplotsset{compat=1.13}
- usepgfplotslibrary{fillbetween}
- usetikzlibrary{patterns}
- pgfplotsset{ticks=none}
- newcommand{newvar}{pgfmathsetmacro}
- begin{document}
- begin{tikzpicture}[scale=1, transform shape]
- newvar{num}{5}
- newvar{val}{num-1}
- coordinate (A) at (0, 0);
- coordinate (B) at (1, 0);
- coordinate (C) at (0, 1);
- coordinate (D) at (0, 2);
- coordinate (E) at (1, 2);
- tikzset{
- square/.pic={
- draw[line width=1mm, pic actions] (0, 0) -- (1, 0) -- (1, 1) -- (0, 1) -- cycle;
- }
- }
- tikzset{
- tile1/.pic={
- foreach i in {(A), (B), (C), (D), (E)}{
- draw i pic {square} ;
- }
- }
- }
- begin{scope}[scale=1]
- foreach i in {0,...,num}{
- foreach j in {0,...,val}{
- path (3*j+i, -j+3*i) pic {tile1};
- }
- }
- end{scope}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement