TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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. – Yossi Farjoun Jan 25 '11 at 11:41
Thank you for the pointers. – Marius Jan 25 '11 at 11:44
up vote 8 down vote accepted

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};
share|improve this answer
Thank you. Looks very nice indeed. – Marius Jan 25 '11 at 12:17

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,


share|improve this answer
Thanks. I'll check it out. – Marius Jan 25 '11 at 12:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.