title: How to view all colormaps available in matplotlib?
body: <p>I was wondering if there is a function call that can give me the name of all colormaps available in matplotlib?</p>
  
  <p>It used to be possible by something along the lines of (see <a href="http://matplotlib.org/1.2.1/examples/pylab_examples/show_colormaps.html" rel="noreferrer">here</a>):</p>
  
  <pre><code>import matplotlib.pyplot as plt
  cmaps = sorted(m for m in plt.cm.datad if not m.endswith("_r"))
  </code></pre>
  
  <p>But running this in mpl 1.5 does not return the new colormaps, such as <code>viridis</code>, <code>magma</code> and so on. On the new reference page the code actually hardcodes the names (see <a href="http://matplotlib.org/examples/color/colormaps_reference.html" rel="noreferrer">here</a>) but I was wondering if a similar query to the above is still possible?</p>