1 import matplotlib.pyplot as plt 2 x = [1,2,3,4,5] 3 y = [1,4,9,16,25] 4 plt.plot(x,y,linewidth=5) #设置线条宽度 5 #设置中文乱码问题 6 plt.rcParams['font.sans-serif'] = ['SimHei'] 7 #设置图标标题,并在坐标轴上添加标签 8 plt.title('多点折线图',fontsize=24) 9 plt.xlabel('x',fontsize=14) 10 plt.ylabel('y=x^2',fontsize=14) 11 plt.show()