0

I am updating a PGFPLOT surface plot that ran fine last year, but not today. Seems the shader I am/was using may have changed. Here's what it looks like: This is what I get with shader=interp

A partial MWE is as follows:

\documentclass[12pt]{standalone} %%{article}
\usepackage{booktabs,colortbl}
\usepackage{pgfplots,pgfplotstable,pgfcalendar}
\usepgfplotslibrary{patchplots}
\usepgfplotslibrary{dateplot}
\usepgfplotslibrary{colorbrewer}
\usepackage{filecontents}

\begin{filecontents}{bike3d.dat}
1  1997  0
2  1997  0
3  1997  0
4  1997  0
5  1997  164
6  1997  164
7  1997  164
8  1997  164
9  1997  164
10 1997  166.1
11 1997  28.9
12 1997  0
........... %240 total lines of data
1  2016  0
2  2016  0
3  2016  0
4  2016  48.4
5  2016  60.5
6  2016  55.2
7  2016  0
8  2016  0
9  2016  0
10 2016  0
11 2016  0
12 2016  0
\end{filecontents}
\pgfplotsset{width=0.90\linewidth,height=7.0cm,,compat=newest}
\pgfplotsset{colormap={hot}{color(0cm)=(darkgray);
 color(0.05cm)=(blue);color(1cm)=(yellow);
 color(2cm)=(orange);color(3cm)=(red)}
}
\headsep=0.5cm
\begin{document}

\begin{tikzpicture}
\begin{axis}[ colorbar, colormap/hot, domain=1:12, y domain=1997:2016,
xtick={1,2,3,4,5,6,7,8,9,10,11,12},
xticklabels={Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec},
ytick={1997,...,2016},zmajorgrids,xmajorgrids,ymajorgrids,
yticklabel shift={0.25cm},
y tick label style={rotate=-40,major tick length=5pt,font=\tiny},
x tick label style={major tick length=5pt,font=\tiny},
/pgf/number format/.cd,
    1000 sep={},
view= {65}{45}
] % az el

\addplot3[surf, shader=interp, mesh/rows=20]file{bike3d.dat};
\end{axis}
\end{tikzpicture} \end{document}

What changed that broke my example? If I take out the shader option, the colors are okay, but I prefer the look of shader=interp. I looked in the change log for version 1.14, but I'm not sure what changed. Any help is appreciated...Dave.

  • 2
    Did you check with another pdf viewer? Beside this: your example doesn't compile, so one can't test it. Also compat=newest is not a good idea. Use the compat level you used to create the plot. – Ulrike Fischer May 2 '17 at 8:30
  • What I meant to convey was the results of using shader=interp. It does compile if you comment the dots in the data and change mesh/rows=20 to 2; there is only 2 years of supplied data instead of 20 (240 lines of data). Try with and without shader=interp in the \addplot3 call. Give it a try. Note that the unchanged code from last year was fine then, but not with version 1.14 PGFPLOTS now. – user50506 May 3 '17 at 7:31
  • I won't spent my time to correct your code when it is easy for you to provide correct code to test your issue. You didn't answer my question if you tried different pdfviewers. You also didn't say if it works with another compat setting, e.g. compat=1.13 or whatever version you used last year. – Ulrike Fischer May 3 '17 at 7:46
  • The code has compiled fine on 2 Win 10 boxes with up to date MikteX. If you take "mesh/rows=20" and change 20 to 2 the MWE compiles fine! I have tested the PDF with Gimp 2.8.20, FoxIt, the latest SumatraPDF but not Acrobat as I do not use it. I will try different compatibility modes (1.12,1.13,1.14 or earlier). – user50506 May 23 '17 at 2:55

Your Answer

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

Browse other questions tagged or ask your own question.