1

I am having trouble compiling even some very simple surface drawing using pgfplot and addplot3, for example please see the attached code, I keep getting error saying \begin{axis} on input line 8 ended by \end{document}, and if I commented those two lines of addplot3 out, it is okay, so I am guessing it is not the problem of Tex-live on Ubuntu. Googled but nobody seems to have a similar issue with this. Any idea?

\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
\begin{axis}
\addplot3[surf,domain=0:10,samples=40, shader=interp]
{x*y};
\end{axis}
\end{tikzpicture}

\end{document}
Shuhao Cao
  • 3,131
  • 3
  • 29
  • 33
  • Your example compiles fine for me, with TeXlive 2011 on Kubuntu. Are you using the TeXlive version found in the Ubuntu repositories? This is somewhat outdated I think, so perhaps you have an older version of pgfplots. – Torbjørn T. Nov 06 '11 at 20:44
  • Yes, I installed tex-live through Synaptic package manager. – Shuhao Cao Nov 06 '11 at 20:54
  • Well, I do not know for certain if that is the problem, but as mentioned it works fine for me. Generally it is actually recommended to install TeXlive using the installer from TUG, and not Synaptic, see http://tex.stackexchange.com/questions/28528/best-way-to-install-packages-for-texlive-in-ubuntu/28533#28533 and http://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu – Torbjørn T. Nov 06 '11 at 20:58
  • @TorbjørnT. Thanks a lot, I am installing the Texlive 2011 now and I will try afterward see if it works. – Shuhao Cao Nov 06 '11 at 21:17
  • The synaptic version is out of date- it uses 2009, not 2011 – cmhughes Nov 06 '11 at 21:50
  • @TorbjørnT. After installing Texlive 2011, the code works like a charm, thanks a lot. – Shuhao Cao Nov 06 '11 at 22:06
  • Good to hear, I'll post it as an answer. – Torbjørn T. Nov 06 '11 at 22:15

1 Answers1

5

The version of pgfplots that is found in the Synaptic repositories is outdated, installing TeXlive 2011 with the installer provided by TUG fixed this. It is actually recommended to use the TUG version, as that allows one to use tlmgr to update the system. See also

Torbjørn T.
  • 206,688