I want to make PGFPlots surf with my colormap rainbow. The funny thing is that I get error
I do not know the key '/pgfplots/colormap/rainbow' and I am going to ignore it. Perhaps you misspelled it.
and despite the error, my colormap is actually used! I guess there is some syntax problem, but I am not able to find it out. Please, help.
MWE:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents}{surfdata.dat}
0 0 0.8
1 0 0.56
2 0 0.5
3 0 0.75
0 2 0.6
1 2 0.3
2 2 0.21
3 2 0.3
0 4 0.68
1 4 0.22
2 4 0.25
3 4 0.4
0 6 0.7
1 6 0.5
2 6 0.58
3 6 0.9
\end{filecontents}
\pgfplotsset{
/pgfplots/colormap={rainbow}{rgb255(0cm)=(96,0,96) rgb255(1cm)=(0,0,192) rgb255(2cm)=(0,160,160) rgb255(3cm)=(96,255,0) rgb255(4cm)=(255,255,0) rgb255(5cm)=(255,192,0) rgb255(6cm)=(255,0,0)}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={0}{90}]
\addplot3[surf,colormap/rainbow] file {surfdata.dat};
\end{axis}
\end{tikzpicture}

\pgfplotsset{colormap/rainbow/.style={colormap={rainbow}{rgb....}}}– percusse Nov 14 '15 at 09:32nameincolormap={name}{rgb...}? – Pygmalion Nov 14 '15 at 11:07