pip list——查询库
pip install requests—— 安装requests库
matplotlib- 一种绘图库 plot图
光标变黑框,按insert键
squares=[] 数据是平方
input_values=[1,2,3,4,5]
折线图:
matplotlib.pyplot.plot(input_values, squares, linewidth=5 线段的宽度)
离散图:
matplotlib.pyplot.scatter(2,4,s=200) 绘制200尺寸的点(2,4)
或者
x_values=[1,2,3,4,5]或者x_values=list(range(1,6))
y_values=[1,4,9,16,25] 或者 y_values=[x**2 for x in x_values]
matplotlib.pyplot.scatter(x_values,y_values,s=200)
import matplotlib.pyplot as plt
plt.title("Square Numbers“,fontsize=24) 标题是Square Numbers,字体24
plt.xlabel(“Values”, fontsize=14) 横坐标标题是Values,字体是14
plt.ylabel 同上
plt.tick_params(axis=‘both’,which=‘major’,labelsize=14) x,y轴同时设置,主要是主刻度线,字体是14
plt.axis([0,1100,0,1100000]) x 坐标轴的取值范围设置为0~1100,并将 y 坐标轴的取值范围设置为0~1 100 000