hyperbolic-paraboloid.tex 933 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. \documentclass[border=2pt]{standalone}
  2. \usepackage{pgfplots}
  3. \pgfplotsset{compat=1.9} %It is possible to remove this line, but you will get a warning
  4. \begin{document}
  5. \pgfplotsset{
  6. colormap={whitered}{
  7. color(0cm)=(white);
  8. color(1cm)=(orange!75!red)
  9. }
  10. }
  11. \begin{tikzpicture}
  12. \begin{axis}[
  13. colormap name=whitered,
  14. width=15cm,
  15. view={340}{25},
  16. enlargelimits=false,
  17. grid=major,
  18. domain=-2:2,
  19. y domain=-2:2,
  20. samples=40, %57 : TeX capacity exceeded, sorry [main memory size=3000000].
  21. % see also http://tex.stackexchange.com/a/7954/5645
  22. xlabel=$x$,
  23. ylabel=$y$,
  24. zlabel={$z$},
  25. colorbar,
  26. colorbar style={
  27. at={(-0.1,0)},
  28. anchor=south west,
  29. height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
  30. title={$f(x,y)$}
  31. }
  32. ]
  33. \addplot3[surf,draw=black] {x^2-y^2};
  34. \end{axis}
  35. \end{tikzpicture}
  36. \end{document}