图形绘制(python matplotlib)入门
这里使用 matplotlib.pyplot 模块来绘制图形,将数据达到可视化的强大工具。
在使用该工具时,需要导入matplotlib。
import matplotlib.pyplot as plt
具体操作(构建散点图的例子):
for point in data:
salary = point[0]
bonus = point[1]
matplotlib.pyplot.scatter( salary, bonus )
matplotlib.pyplot.xlabel("salary")
matplotlib.pyplot.ylabel("bonus")
matplotlib.pyplot.show()