import matplotlib.pyplot as plt plt.figure(1) plt.figure(figsize=(10,40)) plt.subplot(411) plt.plot([1,2,3,4], [1,2,3,4]) plt.subplot(412) plt.plot([1,2,3,4], [1,2,3,4]) plt.subplot(413) plt.plot([1,2,3,4], [1,2,3,4]) plt.subplot(414) plt.plot([1,2,3,4], [1,2,3,4]) x=2 y=2 plt.text(x, y, '({}, {})'.format(x, y)) x=3 y=3 plt.text(x, y, 'message') plt.savefig("testtext.png") plt.show()
最后一幅图放大看text的效果