[Tex/LaTex] PGFPlots viridis colormap

pgfplots

I am trying to create a PGFPlots surf using the colormap viridis in a similar fashion as some examples of the PGFPlots package manual. I will get the error

Package pgfkeys Error: I do not know the key '/tikz/colormap/viridis' and I am going to ignore it. Perhaps you misspelled it. \end{axis}

when using the code

\documentclass{article}
\pagestyle{empty}                       % don't show the page number

\usepackage{graphicx}
\usepackage{algorithmic}
\usepackage{rotating}


\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{colormaps} 
\usetikzlibrary{pgfplots.colormaps} 
\usetikzlibrary[pgfplots.colormaps] 

\begin{document}

\begin{center} 
\begin{tikzpicture}
    \begin{axis}[colormap/viridis , hide axis]
        \addplot3[surf,z buffer=sort,samples=20,domain=-1:0,y domain=0:2*pi]
        ({-2*x * cos(deg(y))},
        {-2*x* sin(deg(y))},
        -x^2+100);
    \end{axis}
\end{tikzpicture}
\end{center} 
\end{document}

I also tried colormap name=viridis, but still no cigar. Any ideas

Thanks in advance.

Best Answer

The colormap 'viridis' is an addon to the latest version of pgfplots. After updating my Latex packages it worked for me.

enter image description here