# 导入相关模块 import matplotlib.pyplot as plt import numpy as np 设置 figure Matplotlib 绘制的图形都在一个默认的 figure 中,我们可以自己创建 figure,可以控制更多的参数,常见的就是控制图形的大小 plt.figure(figsize=(6, 3)) plt.plot(x, y) plt.plot(x, y * 2) plt.show() 设置标题 plt.plot(x, y) plt.plot(x, y *…