I am doing a lineplot with pgfplots. However, instead of the usual legend, I would prefer a colorbar, as I am basically trying to visualize a transition, and for that I chose colors in a gradient like fashion.
How can I add a colorbar below the following MWE plot with clear steps and one label on the left and one label on the right of the colorbar to indicate that my transition is from A to B:
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz,pgfplots}
\pgfplotscreateplotcyclelist{TheBlues}{%
{color=RoyalBlue!50!black},
{color=RoyalBlue!70!black},
{color=RoyalBlue!90!black},
{color=RoyalBlue!90!white},
{color=RoyalBlue!70!white},
{color=RoyalBlue!50!white},
}
\pgfplotsset{cycle list name=TheBlues}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=0,
xmax=1,
axis line style={
very thick,
gray,
shorten <=-0.5\pgflinewidth
},
tick label style ={gray},
axis lines*=left,
]
\foreach \n in {1,2,...,6}
\addplot+[ultra thick,smooth,domain={0:1}] {x^\n};
\end{axis}
\end{tikzpicture}
\end{document}
TheBlues(you could define acolormap={TheBlues}of course) you might be interested in this answer of me: http://tex.stackexchange.com/a/232697 – LaRiFaRi Aug 05 '15 at 12:24TheBluesis mandatory here, you might try to define your own colormap for example. You can become more specific in the question above then. – LaRiFaRi Aug 05 '15 at 12:31