You are reading an old version of the documentation (v2.2.5). For the latest version see https://matplotlib.org/stable/gallery/userdemo/anchored_box01.html
Version 2.2.5
matplotlib
Fork me on GitHub

Related Topics

Anchored Box01ΒΆ

../../_images/sphx_glr_anchored_box01_001.png
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText


fig, ax = plt.subplots(figsize=(3, 3))

at = AnchoredText("Figure 1a",
                  prop=dict(size=15), frameon=True, loc=2)
at.patch.set_boxstyle("round,pad=0.,rounding_size=0.2")
ax.add_artist(at)

plt.show()

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery