zoukankan      html  css  js  c++  java
  • 2-18 matplotlib模块的使用


     

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.array([1,2,3,4,5,6,7,8])
    y = np.array([3,5,7,6,2,6,10,15])
    plt.plot(x,y,'r') # 折线  1 x 2 y 3 color

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.array([1,2,3,4,5,6,7,8])
    y = np.array([3,5,7,6,2,6,10,15])
    plt.plot(x,y,'r') # 折线  1 x 2 y 3 color
    # 折线 饼状 柱状
    plt.plot(x,y,'g',lw=10)# 4 line w

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.array([1,2,3,4,5,6,7,8])
    y = np.array([3,5,7,6,2,6,10,15])
    plt.plot(x,y,'r') # 折线  1 x 2 y 3 color
    # 折线 饼状 柱状
    plt.plot(x,y,'g',lw=10)# 4 line w
    x = np.array([1,2,3,4,5,6,7,8])
    y = np.array([13,25,17,36,21,16,10,15])
    plt.bar(x,y,0.5,alpha=1,color='b')# 5 color 4 透明度 3 0.9
    plt.show()

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.array([1,2,3,4,5,6,7,8])
    y = np.array([3,5,7,6,2,6,10,15])
    plt.plot(x,y,'r') # 折线  1 x 2 y 3 color
    # 折线 饼状 柱状
    plt.plot(x,y,'g',lw=10)# 4 line w
    x = np.array([1,2,3,4,5,6,7,8])
    y = np.array([13,25,17,36,21,16,10,15])
    plt.bar(x,y,0.2,alpha=1,color='b')# 5 color 4 透明度 3 0.9
    plt.show()
  • 相关阅读:
    console.time测试代码块执行时间
    label表单的关联性
    attr返回被选元素的属性值
    2018 885程序设计编程题
    输出斐波拉数列的前n个数(n>=2)
    简单的光照贴图
    复杂纹理复制及纹理叠加效果
    简单纹理复制
    UV旋转shader
    shader实现积雪效果
  • 原文地址:https://www.cnblogs.com/ZHONGZHENHUA/p/9649087.html
Copyright © 2011-2022 走看看