import matplotlib.pyplot as plt import numpy as np # 绘制普通图像 x = np.linspace(-1, 1, 50) y1 = 2 * x + 1 y2 = x**2 plt.figure() plt.plot(x, y1) plt.plot(x, y2, color = 'red', linewidth = 1.0, linestyle = '--') # 设置坐标轴的取值范围 plt.xlim((-1, 1)) plt.ylim((0,