hyperbolic-paraboloid.tex 750 B

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