Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. documentclass[border=5mm]{standalone}
  2.  
  3. usepackage{tikz}
  4. usetikzlibrary{calc}
  5. usetikzlibrary{backgrounds}
  6. usepackage{pgfplots}
  7. pgfplotsset{compat=1.13}
  8. usepgfplotslibrary{fillbetween}
  9. usetikzlibrary{patterns}
  10. pgfplotsset{ticks=none}
  11.  
  12. newcommand{newvar}{pgfmathsetmacro}
  13.  
  14. begin{document}
  15.  
  16. begin{tikzpicture}[scale=1, transform shape]
  17. newvar{num}{5}
  18. newvar{val}{num-1}
  19.  
  20. coordinate (A) at (0, 0);
  21. coordinate (B) at (1, 0);
  22. coordinate (C) at (0, 1);
  23. coordinate (D) at (0, 2);
  24. coordinate (E) at (1, 2);
  25.  
  26. tikzset{
  27. square/.pic={
  28. draw[line width=1mm, pic actions] (0, 0) -- (1, 0) -- (1, 1) -- (0, 1) -- cycle;
  29. }
  30. }
  31.  
  32. tikzset{
  33. tile1/.pic={
  34. foreach i in {(A), (B), (C), (D), (E)}{
  35. draw i pic {square} ;
  36. }
  37. }
  38. }
  39.  
  40. begin{scope}[scale=1]
  41. foreach i in {0,...,num}{
  42. foreach j in {0,...,val}{
  43. path (3*j+i, -j+3*i) pic {tile1};
  44. }
  45. }
  46. end{scope}
  47.  
  48. end{tikzpicture}
  49.  
  50. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement