import matplotlib.pyplot as plt plt.plot([0, 2], [0, 2]) plt.text(0.5, 1, 'put some text') plt.show()