I would like to create a custom colorbar, at the moment I have the following code:
\documentclass[tikz,border={12pt,12pt}]{standalone}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
hide axis, scale only axis, height=0pt, width=0pt, % hide axis
colormap/jet,
colorbar sampled,
colorbar horizontal,
point meta min = 20,
point meta max = 40,
colorbar style = {
samples = 10,
height = 0.5cm,
width = 10cm,
xticklabel style = {
text width = 2.5em,
align = center,
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision = 1,
/tikz/.cd
}
}
]
\addplot [draw=none] coordinates {(0,0)};
\end{axis}
\end{tikzpicture}
\end{document}
- add extend (upper/lower arrow) like the last colorbar of this example http://matplotlib.org/examples/api/colorbar_only.html
- specify just
point meta min
,point meta max
and samples so each colored zone and ticks are aligned without usingxtick = {20,22.22,...,40}
- remove the vertical dashed green line of each tick
- use a custom colormap defined using RGB for example:
[ [191, 191, 191],
[255, 255, 0 ],
[255, 201, 0 ],
[255, 150, 0 ],
[255, 79 , 0 ],
[255, 25 , 0 ],
[229, 0 , 25 ],
[176, 0 , 79 ],
[105, 0 , 150],
[54 , 0 , 201],
[0 , 0 , 255],
[102, 102, 102] ]
Thank you very much.
xtick style={draw=none}
as one of yourcolorbar style
options.