import matplotlib.pyplot as plt
input_values = [1, 2, 3, 4, 5]
squares = [1, 4, 9, 16, 25]
plt.scatter(input_values, squares, s=100)
#设置图表标题并给坐标轴加上书签
plt.title('Squares', fontsize=24)
plt.xlabel('Value', fontsize=14)
plt.ylabel('Squares of value', fontsize=14)
#设置刻度标记的大小
plt.tick_params(axis='both', which='major', labelsize=14)#刻度的样式
plt.show()
Paste_Image.png
网友评论