本节的目标是绘制一个y = x**2的函数图像
plot图表 绘制图表
plot()函数绘制图表,传入参数,输入值和输出值,还可以指定其他参数
plt.plot(input_values, squares, linewidth = 5)
要绘制单个点,可使用函数scatter() ,并向它传递一对 x 和 y 坐标,它将在指定位置绘制一个点
plt.scatter(2, 4, s=200)
传入xy坐标,s表示点的大小
```python
plt.axis([0,1100,0,1100000])
axis设置坐标,传入xy坐标最小值和最大值
matplotlib默认点是蓝色,轮廓是黑色,点太密集时黑色轮廓盖住蓝色点
import matplotlib.pyplot as plt
x_values = list(range(1,1001))
y_values = [x**2 for x in x_values]
# plt.plot(input_values, squares, linewidth = 5)
#设置图表线条粗细
plt.scatter(x_values, y_values, c ='red', edgecolor = 'none',s=40)
#标题xy坐标
plt.title("Squares Numbers", fontsize = 14)
plt.xlabel("Value",fontsize = 14)
plt.ylabel("Square of Value",fontsize = 14)
#axis坐标轴
#设置每个坐标轴的取值范围
plt.axis([0,1100,0,1100000])
plt.savefig('squares_plot.png',bbox_inches='tight')
# plt.show()