import matplotlib.pyplot as plt
input_values = [1, 2, 3, 4, 5]
squares = [1, 4, 9, 16, 25]
x_value = list(range(1, 1001))
y_value = [x ** 2 for x in x_value]
plt.plot(input_values,squares,linewidth=5)#linewidth线条粗细
edgecolors()删除数据点的轮廓
c()自定义颜色
使用颜色映射
plt.scatter(x_value, y_value, c=y_value, cmap=plt.cm.Reds, edgecolors=‘none’, s=40)
plt.scatter(x_value, y_value, c=‘red’, edgecolors =‘none’, s=20)
设置图标标题,并给坐标轴加标签
plt.title(“squares numbers”, fontsize=24)
plt.xlabel(“value”, fontsize=14)
plt.ylabel(“squares of value”, fontsize=14)
设置刻度标记的大小
plt.tick_params(axis=‘both’, labelsize=14)
设置每个坐标的取值范围
plt.axis([0, 1100, 0, 1100000])
plt.show()