您可以使用
transform关键字:
import matplotlib.pyplot as pltimport numpy as npfig = plt.figure() ax = fig.add_subplot(1, 1, 1)ax.plot(np.arange(10),12*np.arange(10)) ax.text(0.4, 0.7, 'Correct Position', transform=ax.transAxes)plt.show()

您可以使用
transform关键字:
import matplotlib.pyplot as pltimport numpy as npfig = plt.figure() ax = fig.add_subplot(1, 1, 1)ax.plot(np.arange(10),12*np.arange(10)) ax.text(0.4, 0.7, 'Correct Position', transform=ax.transAxes)plt.show()