```python
import numpy as np
import matplotlib.pyplot as plt
import os
x=np.linspace(0, 10, 30)
noise=np.random.randn(30)
y1=x**2+2*noise
y2=x**1+2*noise
y3=x**1.5+2*noise
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.rc('font', size=14)
plt.figure(figsize=(6,4))
plt.plot(x,y1,color = 'r',linestyle = '--')
plt.plot(x,y2,color = 'b',linestyle = '-')
plt.plot(x,y3,color = 'b',linestyle = '-.')
plt.title('折线图')
plt.legend(['曲线y1','曲线y2','曲线y3'])
plt.xlabel('x')
plt.ylabel('y')
path='D:\\my_python\\ch3\\output\\'
if not os.path.exists(path):
os.makedirs(path)
plt.savefig(path+'scatter.jpg')
plt.savefig(path+'plot.jpg')
plt.show()
