Is there any built-in functionality in TiKz/PGF that allows for drawing quadric surfaces, i.e. surfaces given by the equation

Ax^2 + By^2 + Cz^2 + Dz = E?

I'm aware of the raw gnuplot command enabling the use of virtually every gnuplot command (at least to my knowledge).

I tried using the following command:

\draw[thick] plot[raw gnuplot] function{set urange [0:2*pi]; set vrange [0:pi]; set parametric; set isosample 40; splot cos(u)*sin(v)/3, sin(u)*sin(v), cos(v)};  

but the result is less than satisfactory.

  • welcome to TeX and friends! I hope you enjoy your stay here. Use four spaces inthe begining of a line (or select and click the 10101 button) to create a "code" section and please note that as your badge appears at the end of your entry, there's no need to sign-off. Commented Jan 25, 2011 at 11:41

2 Answers 2


You might be interessted in PGFplots (see: pgfplots.sf.net)

         3d box=background,
      % pretty printing, but irrelevant:
   title={3d box=background},
  \addplot3[surf] {1*x*y};

In the official documentation of PGFplots, therer's are some options mentioned about parametric ploting:

  • /pgfplots/parametric
  • /pgfplots/parametric/var 1d
  • /pgfplots/parametric/var 2d

With PGFplots you can use GNUplot aswell:

    \addplot3 gnuplot[raw gnuplot] {set parametric;splot[t=0:6*pi] cos(t),sin(t),t/2*pi};

with pst-solides3d which allows hidden surfaces. Here is only the code for the first example. Can be run with xelatex if you need a pdf output



\psset{viewpoint=30 90 0 rtp2xyz,lightsrc=viewpoint,Decran=90}
  base=0 pi dup add 0 pi,



You must log in to answer this question.

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