[Tex/LaTex] pgfplots – surf – Standard color schemes


Are there standard color schemes defined for surface plots of pgfplots?

Like the summer, winter, jet etc.. of Matlab.

Matlab colormap

Best Answer

There are a lot of standard colormaps defined in PGFPlots. For that have a look at at the PGFPlots manual (v1.14)

  • section "Predefined Colormaps" which is a subsection of section 4.7.6 on page 194,
  • section 5.3 Colormaps on page 419, which is the description of the library with the same name and provides colormaps of the free Matlab package "SC -- powerful image rendering" of Oliver Woodford, and
  • section 5.2 ColorBrewer which shows how to access the famous colormaps from http://colorbrewer2.org.

Of course you can also create your own colormaps either from scratch or combine colormaps from already existing ones or newly created. Here I present an example which is copied from the manual

            colormap={whiteblue}{color=(blue) color=(white)},
            colormap={gb}{color=(green) color=(yellow)
            colorbar horizontal,
            colorbar style={minor x tick num=1},
            y dir=reverse,
            %  The table file is packed into the archive
            % `doc/latex/pgfplots/pgfplots.doc.src.tar.bz2'
            \addplot3 [
                contour filled={
                    levels from colormap={
                        of colormap={
                            target pos max=,
                            target pos={-12000,-10000,-6000,
                        of colormap={
                            target pos min=,
                            target pos={10,100,200,500,1000,
                                1100,1200, 1500,2000,4000,
            ] table {heightmap.dat};

image showing the result of above code