Niuxingyu
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt


if __name__ == "__main__":
    #第一组数据
    x1 = list(range(5))
    y1 = list(map(lambda x:x**2,x1))

    #第二组数据
    x2 = list(range(5,11))
    y2 = list(map(lambda x:x**2/2,x2))

    #做第一幅图 2*1矩阵
    ax1 = plt.subplot(121)
    #传入数据7
    ax1.plot(x1,y1)
    #为第一张图片设置标题
    plt.title(\'d1\')

    ax2 = plt.subplot(122)
    #传入数据
    ax2.plot(x1,y1)
    #为第二张图片设置标题
    plt.title(\'d2\')

    #删除子图
    plt.delaxes(ax2)
    
    plt.subplot(ax2)

    #绘制
    plt.show()

 

分类:

技术点:

相关文章:

  • 2021-11-19
  • 2021-11-26
  • 2021-11-27
  • 2021-09-23
  • 2022-12-23
  • 2021-06-05
  • 2021-06-19
  • 2021-05-28
猜你喜欢
  • 2021-11-02
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2022-12-23
相关资源
相似解决方案