Version 3.1.2
matplotlib

Related Topics

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.

Traceback (most recent call last):
  File "/build/matplotlib-mO9dyQ/matplotlib-3.1.2/examples/text_labels_and_annotations/titles_demo.py", line 1
    ===========
    ^
SyntaxError: invalid syntax
===========
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.

"""
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: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery