TikZ – Drawing a Ruled Surface like Hyperbolic Paraboloid

tikz-pgf

At the risk of asking YET ANOTHER TIKZ question on a general TeX forum :), I was wondering if there was any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ? I'm not particular about the surface per se: I just need some eye candy for a nontrivial looking surface, and the hyperbolic paraboloid is a good example because of the negative curvature. I checked texample.net and google, and while I found a PSTricks package that can do this, it doesn't fit my workflow with pdflatex and Beamer.

Best Answer

PGFplots can do a reasonably good job with not too complex 3D plots. Here's an example of a hyperbolic paraboloid:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3 [surf,shader=flat,draw=black] {x^2-y^2};
\end{axis}
\end{tikzpicture}
\end{document}

hyperbolic paraboloid with PGFplots

Related Question