You are reading an old version of the documentation (v2.0.1). For the latest version see


This Page

pylab_examples example code: titles_demo.pyΒΆ

(Source code, png, pdf)

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.title('Center Title')
plt.title('Left Title', loc='left')
plt.title('Right Title', loc='right')

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