Answers for "how to add text to matplotlib"

2

matplotlib insert text

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
textstr = "Test"
ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=14,
        verticalalignment='top')
Posted by: Guest on May-27-2021
2

add text to plot python

import matplotlib.pyplot as plt
w = 4
h = 3
d = 70
plt.figure(figsize=(w, h), dpi=d)
x = [1, 2, 4]
x_pos = 0.5
y_pos = 3
plt.text(x_pos, y_pos, "text on plot")
plt.plot(x)
plt.savefig("out.png")Outputout.png
Posted by: Guest on March-25-2021

Code answers related to "how to add text to matplotlib"

Python Answers by Framework

Browse Popular Code Answers by Language