美文网首页
用scatter画一系列的点

用scatter画一系列的点

作者: sbill | 来源:发表于2017-04-03 21:32 被阅读0次
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

相关文章

网友评论

      本文标题:用scatter画一系列的点

      本文链接:https://www.haomeiwen.com/subject/ylwoottx.html