[Tex/LaTex] How to change color of 3D surface on pgfplots

pgfplotstikz-pgf

I want to change color of 3D surface like picture(exactly).
How is it possible?
enter image description here

  \documentclass[border=5mm]{standalone}

    \usepackage{pgfplots}
    \pgfplotsset{compat=1.6}

    \begin{document}
    \begin{tikzpicture}
    \begin{axis}[
        domain=-180:180,
        colorbar,
        colorbar style={
            title=Color key,
            ylabel=Z-value,
            ytick={-1,-0.75,...,1},
            yticklabel style={
                text width=2.5em,
                align=right,
                /pgf/number format/.cd,
                    fixed,
                    fixed zerofill
            }
        }
    ]
    \addplot3 [surf] {sin(x) * sin(y)};
    \end{axis}
    \end{tikzpicture}
    \end{document}

Best Answer

The colormap in your right image is the PuYG colormap from the ColorBrewer website. PGFPlots contains a library that provides the colormaps from the website.

To use the colormaps, put \usepgfplotslibrary{colorbrewer} in the preamble and activate the desired colormap using colormap/PuYG:

enter image description here

\documentclass[border=5mm]{standalone}

\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\usepgfplotslibrary{colorbrewer}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
domain=-180:180,
samples=50,
colormap/PiYG,
colorbar,
colorbar style={
    title=Color key,
    ylabel=Z-value,
    ytick={-1,-0.75,...,1},
    yticklabel style={
        text width=2.5em,
        align=right,
        /pgf/number format/.cd,
            fixed,
            fixed zerofill
        }
    }
]
\addplot3 [surf] {sin(x) * sin(y)};
\end{axis}
\end{tikzpicture}
\end{document}