.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_intro_matplotlib_auto_examples_options_plot_colormaps.py: Colormaps ========= An example plotting the matplotlib colormaps. .. image:: /intro/matplotlib/auto_examples/options/images/sphx_glr_plot_colormaps_001.png :class: sphx-glr-single-img .. code-block:: python import numpy as np import matplotlib.pyplot as plt plt.rc('text', usetex=False) a = np.outer(np.arange(0, 1, 0.01), np.ones(10)) plt.figure(figsize=(10, 5)) plt.subplots_adjust(top=0.8, bottom=0.05, left=0.01, right=0.99) maps = [m for m in plt.cm.datad if not m.endswith("_r")] maps.sort() l = len(maps) + 1 for i, m in enumerate(maps): plt.subplot(1, l, i+1) plt.axis("off") plt.imshow(a, aspect='auto', cmap=plt.get_cmap(m), origin="lower") plt.title(m, rotation=90, fontsize=10, va='bottom') plt.show() **Total running time of the script:** ( 0 minutes 0.770 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_options_plot_colormaps.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_colormaps.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_colormaps.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_