.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_text_labels_and_annotations_titles_demo.py: =========== Titles Demo =========== matplotlib can display plot titles centered, flush with the left side of a set of axes, and flush with the right side of a set of axes. .. image:: /gallery/text_labels_and_annotations/images/sphx_glr_titles_demo_001.png :class: sphx-glr-single-img .. code-block:: python import matplotlib.pyplot as plt plt.plot(range(10)) plt.title('Center Title') plt.title('Left Title', loc='left') plt.title('Right Title', loc='right') plt.show() .. _sphx_glr_download_gallery_text_labels_and_annotations_titles_demo.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: titles_demo.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: titles_demo.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature Keywords: matplotlib code example, codex, python plot, pyplot `Gallery generated by Sphinx-Gallery `_