I'm interested in the hyperboloid u^2 + v^2 - w^2 = 1, which can be parameterized as
u = cosh(x) cos(y),
v = cosh(x) sin(y),
w = sinh(x).
This parameterization can be used to draw the hyperboloid in pgfplots as follows:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,
fill=white,
samples=10,
samples y=72,
domain=-1:1,
y domain=0:360,
z buffer=sort]
( {cosh(x)*cos(y)}, {cosh(x)*sin(y)}, {sinh(x)} );
\end{axis}
\end{tikzpicture}
\end{document}
That works beautifully, but now I would like to restrict the plot to, say, the region where v + w > 0. In terms of my (x,y) parameters this reads cosh(x) sin(y) + sinh(x) > 0. According to the PGFPlots manual I should be able to use the restrict expr to domain option to accomplish this, but when I try it I get a LaTeX error:
! Package PGF Math Error: Could not parse input '' as a floating point number, sorry. The unreadable part was near ''..
I'm assuming this option should be given at the \addplot3 level, not at the \begin{axis} level, but the error appears either way.
Actually what I would like to do is plot the hyperboloid twice; first, the full hyperboloid in a nice subdued gray, and then, on top of it, the region of interest in bright colors, so that it can actually be identified as part of the hyperboloid.
I'm providing an updated MWE since I guess the whole thing got a bit confusing with all the changing in variable names. Here's what I intended to do:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={120}{5},
samples=20,
samples y=72,
domain=-2:2,
y domain=0:360,
z buffer=sort,
variable=\u,
variable y=\v]
\addplot3[surf,
restrict expr to domain={y+z}{0:100}]
( {cosh(u)*cos(v)}, {cosh(u)*sin(v)}, {sinh(u)} );
\end{axis}
\end{tikzpicture}
\end{document}
With the unstable version of pgfplots installed, this draws only half of the hyperboloid---the half determined by the condition y + z > 0---, as expected.