I would like to show the graph of $f(x,y)=4-x^{2}-y^{2}$ for $x^{2}+y^{2}\leq1,y\geq0$.

I want to draw it using spherical coordinates in Tikz. However I've not found any simple answer for this. Could someone help me?

1 Answer 1


Something like that?

\begin{tikzpicture}[declare function={f(\x,\y)=4-\x^2-\y^2;}]
  \addplot3[surf,shader=interp,domain=0:1,domain y=0:180]

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .