matplotlib的基本用法
线性图的一些参数设置
散点图的参数设置
画布
fig, axes = plt.subplots(nrows=1, ncols=2) # 子图为 1 行,2 列
for ax in axes:
ax.plot(x, y, 'r')
fig, axes = plt.subplots(1, 2, figsize=(10, 5))
# 显示网格
axes[0].plot(x, x**2, x, x**3, lw=2)
axes[0].grid(True)
# 设置坐标轴范围
axes[1].plot(x, x**2, x, x**3)
axes[1].set_ylim([0, 60])
axes[1].set_xlim([2, 5])