1

Consider this MWE:

enter image description here

I have 32 plots, and I want the colormap to be distributed evenly across all the plots. At the moment, after 9 plots, the colours cycle back to the start. Is there any way to increase the number of discrete colours used by the colormap? I thought maybe cycle list/Oranges-32 would work, but no.

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{colorbrewer}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[
        cycle list/Oranges,
    ]
    \foreach \X in {1,...,32}{%
        \addplot {rnd-\X};
    }
    \end{axis}
\end{tikzpicture}
\end{document}
3

I think colors of colormap from p. 220 of the manual can help here. Of course you can replace hot by whatever you like and adjust the step size.

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[colormap name=hot,%colorbar,
    cycle list={[colors of colormap={0,30,...,1000}]}]
    \foreach \X in {1,...,32}{%
        \addplot {rnd-\X};
    }
    \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.