title: Standalone colorbar (matplotlib)
body: <p>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 <code>ImageGrid</code>, etc.). <strong>I would like to create and save a standalone colorbar with <code>savefig</code>, without needing to use <code>imshow</code>.</strong></p>
  
  <p>(the <code>vlim, vmax</code> parameters, as well as the <code>cmap</code> could be provided explicitly)</p>
  
  <p>The only way I could find was quite complicated and (from what I understand) draws a hard-coded rectangle onto the canvas:
  <a href="http://matplotlib.org/examples/api/colorbar_only.html" rel="noreferrer">http://matplotlib.org/examples/api/colorbar_only.html</a></p>
  
  <p><strong>Is there an elegant way to create a standalone colorbar with matplotlib?</strong></p>