Answers for "matplotlib text on plot"

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
0

add caption to plot python

txt="I need the caption to be present a little below X-axis"
plt.figtext(0.5, 0.01, txt, wrap=True, horizontalalignment='center', fontsize=12)
Posted by: Guest on January-10-2021

Code answers related to "matplotlib text on plot"

Python Answers by Framework

Browse Popular Code Answers by Language