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

I have the following example which produces a klein bottle. Whatever I compile with the option --shell-escape and I get the following warning:

"<file>.pgf-plot.gnuplot", line 2: ';' expected

Where is my mistake in the example and how can I fix this.

\begin{axis}[axis equal image,axis lines=none,view={150}{40},]
\addplot3 [raw gnuplot,mesh] gnuplot [mesh]{
   set parametric;
   set pm3d explicit;
   set pal rgb 9,9,3;
   set hidden3d;
   set isosamples 18,48;
   set xrange[-8:10];
   set yrange[-9:9];
   set urange[0:2*pi];
   set vrange[0:4*pi];
   x(u,v)= v<pi ? (2.5-1.5*cos(v))*cos(u): v<2*pi ? (2.5-1.5*cos(v))*cos(u): v<3*pi ? -2+(2+cos(u))*cos(v): -2+2*cos(v)-cos(u);
   y(u,v)= v<pi ? (2.5-1.5*cos(v))*sin(u):  v<2*pi ? (2.5-1.5*cos(v))*sin(u):  v<3*pi ? sin(u): sin(u);
   z(u,v)= v<pi ? -2.5*sin(v): v < 2*pi ? 3*v-3*pi: v<3*pi ? (2+cos(u))*sin(v)+3*pi: -3*v+12*pi;
   set multiplot;
   splot x(u,v),y(u,v),-z(u,v) w pm3d
   splot x(u,v),y(u,v),-z(u,v) lt 4
   unset multiplot;

Here the relevant part of my file list:

pgfplots.sty    2011/12/29 v1.5.1 (git show 1.5.1-4-g53e640f )
    tikz.sty    2011/06/07 v2.10-cvs (rcs-revision 1.81)

Add-on: How can I increase the size of the picture?

enter image description here

share|improve this question
up vote 7 down vote accepted

Adding semi-colons after these eliminates the warning:

   splot x(u,v),y(u,v),-z(u,v) w pm3d;
   splot x(u,v),y(u,v),-z(u,v) lt 4;

Adding scale=2 to the \begin{axis} options should increase the size.

share|improve this answer

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.