3d-manhattan-bar-plot.tex 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{pgfplots}
  5. \begin{document}
  6. \begin{preview}
  7. \begin{tikzpicture}
  8. \begin{axis}[
  9. view = {120}{35},% important to draw x,y in increasing order
  10. xmin = 0,
  11. ymin = 0,
  12. xmax = 4,
  13. ymax = 4,
  14. zmin = 0,
  15. unbounded coords = jump,
  16. colormap={pos}{color(0cm)=(white); color(6cm)=(blue)}
  17. ]
  18. \addplot3[surf,mark=none] coordinates {
  19. (0,0,0.0) (0,0,0.0) (0,1,0.0) (0,1,0.0) (0,2,0.0) (0,2,0.0) (0,3,0.0) (0,3,0.0) (0,4,0.0) (0,4,0.0)
  20. (0,0,0.0) (0,0,2) (0,1,2) (0,1,3) (0,2,3) (0,2,1) (0,3,1) (0,3,0) (0,4,0) (0,4,0.0) (1,0,0.0)
  21. (1,0,2) (1,1,2) (1,1,3) (1,2,3) (1,2,1) (1,3,1) (1,3,0) (1,4,0) (1,4,0.0)
  22. (1,0,0.0) (1,0,0) (1,1,0) (1,1,6) (1,2,6) (1,2,0) (1,3,0) (1,3,0) (1,4,0) (1,4,0.0) (2,0,0.0)
  23. (2,0,0) (2,1,0) (2,1,6) (2,2,6) (2,2,0) (2,3,0) (2,3,0) (2,4,0) (2,4,0.0)
  24. (2,0,0.0) (2,0,1) (2,1,1) (2,1,0) (2,2,0) (2,2,0) (2,3,0) (2,3,4) (2,4,4) (2,4,0.0) (3,0,0.0)
  25. (3,0,1) (3,1,1) (3,1,0) (3,2,0) (3,2,0) (3,3,0) (3,3,4) (3,4,4) (3,4,0.0)
  26. (3,0,0.0) (3,0,0) (3,1,0) (3,1,0) (3,2,0) (3,2,0) (3,3,0) (3,3,0) (3,4,0) (3,4,0.0) (4,0,0.0)
  27. (4,0,0) (4,1,0) (4,1,0) (4,2,0) (4,2,0) (4,3,0) (4,3,0) (4,4,0) (4,4,0.0)
  28. (4,0,0.0) (4,0,0.0) (4,1,0.0) (4,1,0.0) (4,2,0.0) (4,2,0.0) (4,3,0.0) (4,3,0.0) (4,4,0.0) (4,4,0.0)
  29. };
  30. \end{axis}
  31. \end{tikzpicture}
  32. \end{preview}
  33. \end{document}