matplotlib 之 快速入门

教程链接:https://blog.csdn.net/weixin_45459224/article/details/100177163

#-*-coding:gb2312-*-
import matplotlib
import matplotlib.pyplot as plt

if __name__ == '__main__':
    # 设置中文
    matplotlib.rcParams['font.sans-serif'] = ['SimHei']
    # 设置一堆坐标
    x=[0,1,2,3,4,5,6]
    y=[0,5,7,8,12,16,20]
    # 设置线段信息
    plt.plot(x,y,'r') # 折线图
    plt.show()

 

  plt.scatter(x,y)  

 plt.bar(x,y) 

原文地址:https://www.cnblogs.com/sabertobih/p/13920129.html