3

I copied this example from page 134 of the pgfplots manual (version 1.12.1):

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.12}
\usepgfplotslibrary{patchplots}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[small,view={0}{90}]
    \addplot3[surf,shader=interp,patch type=bilinear,
        mesh/color input=explicit]
    coordinates {
        (0,0,0) [color=blue] (1,0,0) [color=green]
        (0,1,0) [color=yellow] (1,1,1) [color=red]
    };
    \end{axis}
\end{tikzpicture}

\end{document}

But when I tried to compile it, I got this error message:

Package pgfplots Error: CRITICAL: shader=interp: got unsupported
pdf shading type '0'. This may corrupt your pdf!.

See the pgfplots package documentation for explanation.

For what it's worth, I get this error when compiling several of the other examples in the same section (Two/Three Dimensional Plot Types).

I am using MacTeX-2015, and TeX Live Utility shows no updates are available.

7

The code from the manual's examples works fine. Yours fails because you have lost a blank line:

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.12}
\usepgfplotslibrary{patchplots}

\begin{document}
\begin{tikzpicture}% 134
    \begin{axis}[small,view={0}{90}]
    \addplot3[surf,shader=interp,patch type=bilinear,
        mesh/color input=explicit]
    coordinates {
        (0,0,0) [color=blue] (1,0,0) [color=green]

        (0,1,0) [color=yellow] (1,1,1) [color=red]
    };
    \end{axis}
\end{tikzpicture}
\end{document}

plot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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