笔记|python Matplotlib 绘制多个子图

from matplotlib import pyplot as plt import numpy as npa = np.arange(1, 30) # 划分子图 fig, axs = plt.subplots(2, 2) # 绘制子图 axs1 = axs[0, 0] axs2 = axs[0, 1] axs3 = axs[1, 0] axs4 = axs[1, 1] axs1.plot(a, a) axs2.plot(a, np.sin(a)) axs3.plot(a, np.log(a)) axs4.plot(a, a ** 2) plt.show()

笔记|python Matplotlib 绘制多个子图
文章图片

【笔记|python Matplotlib 绘制多个子图】

    推荐阅读