In a graphic, add a plain text annotation through text
Text all related parameters: official website link
#!/usr/bin/python
#coding: utf-8
import numpy as NP
import Matplotlib.pyplot as plt
x = Np.arange (-10, One, 1)
y = x * * * 2
plt.plot (x, y)
# The first parameter is the x-axis coordinate
# The second parameter is the Y coordinate
# The third parameter is the transparency of the
# Alpha setting font
# Family set Font
# size Set the size of the font
# style Set the style of the font
# wight The weight of the font #
bbox to add a box to the font, Alpha set the transparency of the box body, facecolor Settings box Color
plt.text ( -3,, "function:y = x * x", size =, alpha = 0.2)
plt.text ( -3,, "function:y = x * x", size = 15,\
family = "Fantasy", color = "R", style = "Italic", Weight = "light", \
bbox = dict (Facecolor = "R", Alpha = 0.2))
plt.show ()