Adding text annotations

We can add text to our plot by calling plt.text(x,y,text); we specify the x and y coordinates and the text string.
Here is a quick example:

plt.text(0.25,0.5,'Hello World!',fontsize=30)
plt.show()

You can see in this figure the Hello World! message appearing in the center of the plot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.45.33