4

I am using pgfplots

\begin{figure}
  \centering
  \begin{tikzpicture}
    \begin{axis}[width=\linewidth]
        \addplot3[surf, mesh/cols=41,mesh/ordering=colwise,faceted color=black,shader=faceted interp] table {P.dat};
    \end{axis}
  \end{tikzpicture}
\end{figure}

my P.dat is here: http://pastebin.com/xdevrCNF

Note that the same code compiles if I omit the shader directive

4
  • Also, what backend are you using, pdftex, luatex?
    – alfC
    Commented Feb 13, 2014 at 20:43
  • I am using xelatex and I am getting the following error ! Missing number, treated as zero. <to be read again> \ l.355 \end{axis} Commented Feb 13, 2014 at 20:57
  • I am currently updating my distribution and will check it out again Commented Feb 13, 2014 at 21:01
  • Still the same error Commented Feb 13, 2014 at 21:04

1 Answer 1

5

This is a bug in the xetex driver of pgfplots. Apparently, the bug does not show up for shader=interp although it is present as well (pollutes log file, I guess).

I have fixed it in the developer version of pgfplots.

That means you have the following options:

  1. wait a couple of days until I have updated the unstable revision on http://pgfplots.sourceforge.net/ and install that one or
  2. wait for the next stable of pgfplots and upgrade or
  3. use shader=interp or
  4. use a hotfix patch, see below.

Here is the hotfix: write

\makeatletter
\let\pgfplotssys@do@surfshading@fillpaths@@@=\pgfplotssys@do@surfshading@fillpaths
\def\pgfplotssys@do@surfshading@fillpaths#1{%
    \let\pgfplots@loc@TMPb=\relax
    \pgfplotssys@do@surfshading@fillpaths@@@{#1}%
}
\makeatother

into the preamble of your document and the problem is gone.

2
  • Indeed it compiles ok with pdflatex. But it seems that the pdf renders slowly in the page of the graph. Any suggestions on how to fix this? Commented Feb 14, 2014 at 14:38
  • This is a weakness of faceted interp. The issue along with potential alternatives is discussed in the manual in the documentation of the patchplots library; the section is called "Drawing Grids". Commented Feb 14, 2014 at 19:38

You must log in to answer this question.

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