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

matplotlib 之 快速入门

#-*-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()

 matplotlib 之 快速入门

  plt.scatter(x,y)  

matplotlib 之 快速入门

 plt.bar(x,y) 

matplotlib 之 快速入门

 

相关文章:

  • 2022-12-23
  • 2021-12-03
  • 2021-12-24
  • 2021-07-02
  • 2021-04-27
  • 2022-02-07
  • 2021-07-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2021-10-18
  • 2021-12-31
  • 2021-12-30
  • 2021-10-06
  • 2021-11-19
相关资源
相似解决方案