Guest User

Untitled

a guest
Mar 20th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. documentclass{minimal}
  2. usepackage{tikz}
  3. usetikzlibrary{matrix}
  4.  
  5. begin{document}
  6. begin{tikzpicture}
  7. defx{2}
  8. defy{2}
  9. defz{3}
  10. defyscale{0.850000}
  11. defzslant{1.000000}
  12. defxlab{x}
  13. defylab{y}
  14. defzlab{z}
  15. defgridcol{black!80}
  16. defshadecolA{white}
  17. defshadecolB{black!20}
  18. tikzset{
  19. grid matrix/.style={
  20. nodes in empty cells,
  21. matrix of nodes,
  22. column sep=-pgflinewidth, row sep=-pgflinewidth,
  23. nodes={
  24. rectangle,
  25. draw=gray,
  26. minimum height=1cm,
  27. anchor=center,
  28. align=center,
  29. text width=1cm,
  30. text height=2ex,
  31. text depth=0.5ex,
  32. inner sep=0pt,
  33. outer sep=0pt,
  34. }
  35. },
  36. grid matrix/.default=1.2em
  37. }
  38.  
  39. begin{scope}
  40.  
  41. % top matrix
  42. begin{scope}[transform canvas={xslant=zslant, yscale=yscale, shift={(-0.5*z, 0.5 * x)}, },transform shape]
  43. draw[color=black, thick, ] (-0.5* z,-0.5* x) rectangle (0.5* z, 0.5* x);
  44. shade[bottom color=shadecolA, top color=shadecolB] (-0.5* z,-0.5* x) rectangle (0.5* z, 0.5* x);
  45.  
  46. matrix (top) [grid matrix]{
  47. |[fill=none]| 4 & |[fill=none]| 8 & |[fill=none]| 12 \
  48. |[fill=none]| 2 & |[fill=none]| 4 & |[fill=green]| 6 \
  49. };
  50. node [above, rotate=90, text width=x * 1cm, align=center] at (top.west) {xlab};
  51. end{scope}
  52.  
  53. % front matrix
  54. begin{scope}[shift={(-0.5*z, -0.5 * y)}]
  55. draw[color=black, thick, fill=shadecolA] (-0.5* z,-0.5* y) rectangle (0.5* z, 0.5* y);
  56. %shade[left color=gray!10, right color=black!60] (-0.5* z,-0.5* y) rectangle (0.5* z, 0.5* y);
  57.  
  58. matrix (front) [grid matrix]{
  59. |[fill=none]| 1 & |[fill=none]| 2 & |[fill=green]| 3 \
  60. |[fill=red]| 1 & |[fill=red]| 2 & |[fill=red]| 3 \
  61. };
  62. node [below, text width=z * 1cm, align=center] at (front.south) {zlab};
  63. node [above, rotate=90, text width=y * 1cm, align=center] at (front.west) {ylab};
  64. end{scope}
  65.  
  66. % side matrix
  67. begin{scope}[transform canvas={yslant=1/zslant, xscale=yscale*zslant, shift={(0.5*x,-0.5*y)}, },transform shape]
  68. draw[color=black, thick] (-0.5* x,-0.5* y) rectangle (0.5* x, 0.5* y);
  69. shade[left color=shadecolA, right color=shadecolB] (-0.5* x,-0.5* y) rectangle (0.5* x, 0.5* y);
  70.  
  71. matrix (side) [grid matrix]{
  72. |[fill=green]| 1 & |[fill=none]| 2 \
  73. |[fill=red]| 3 & |[fill=red]| 4 \
  74. };
  75. end{scope}
  76. end{scope}
  77.  
  78. end{tikzpicture}
  79. end{document}
Add Comment
Please, Sign In to add comment