You are reading an old version of the documentation (v2.0.0). For the latest version see https://matplotlib.org/stable/
matplotlib

Travis-CI:

This Page

pylab_examples example code: titles_demo.pyΒΆ

(Source code, png, pdf)

../../_images/titles_demo.png
"""
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.

"""
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()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)