Answers for "add text on plot 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
0

Matplotlib add text to axes

#Axis.text() method
https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html

ax1.text(1.1, -300, 'Label', color='#af0b1e',
         weight='bold', rotation=3)
         
Add the text s to the Axes at location x, y in data coordinates.
Posted by: Guest on August-21-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

Python Answers by Framework

Browse Popular Code Answers by Language