We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates


Previous topic

pylab_examples example code: text_rotation_relative_to_line.py

Next topic

pylab_examples example code: to_numeric.py

This Page

pylab_examples example code: titles_demo.pyΒΆ

(Source code, png, hires.png, pdf)

#!/usr/bin/env python
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)