- 1 import sys
- 2 reload(sys)
- 3sys.setdefaultencoding("utf-8")
- 4 import matplotlib.pyplot as plt
- 5 import numpy as np
- 6
- 7plt.figure()## 实例化作图变量
- 8plt.title("single variable")#图像标题
- 9plt.xlabel("x")
- 10plt.ylabel("y")
- 11plt.axis([30, 400, 100, 400])
- 12plt.grid(True)# 是否绘制网格线
- 13
- 14xx = [[50],[100], [150], [200], [250], [300]]
- 15yy = [[150], [200], [250], [280], [310], [330]]
- 16plt.plot(xx, yy,'k.')
- 17plt.show()
来源: http://www.bubuko.com/infodetail-1978838.html