Note
Click here to download the full example code
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-xz4j8t/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