.. _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 :align: center .. 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() .. only :: html .. container:: sphx-glr-footer .. 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 `Gallery generated by Sphinx-Gallery `_