Overview
Matplotlib 3.9, released on May 16, 2024, improves text placement with tags and annotation handling.
Main Features
Tag text
The tag_text method simplifies adding automatically positioned labels on plots.
python
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots()
x = np.linspace(0, 10, 100)
ax.plot(x, np.sin(x), label='sin(x)')
ax.plot(x, np.cos(x), label='cos(x)')
ax.legend()
ax.set_title('Trigonometric functions')
plt.show()
