I'm rendering some graphics in python with matplotlib, and will include them into a LaTeX paper (using LaTex's nice tabular alignment instead of fiddling with matplotlib's ImageGrid
, etc.). I would like to create and save a standalone colorbar with savefig
, without needing to use imshow
.
(the vlim, vmax
parameters, as well as the cmap
could be provided explicitly)
The only way I could find was quite complicated and (from what I understand) draws a hard-coded rectangle onto the canvas: http://matplotlib.org/examples/api/colorbar_only.html
Is there an elegant way to create a standalone colorbar with matplotlib?