You are reading an old version of the documentation (v2.1.2). For the latest version see https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html
Version 2.1.2
matplotlib
Fork me on GitHub


Travis-CI:

Related Topics

This Page

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.

../../_images/sphx_glr_titles_demo_001.png
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()

Total running time of the script: ( 0 minutes 0.023 seconds)

Gallery generated by Sphinx-Gallery