美文网首页
matplotlib的简单实用(画线)

matplotlib的简单实用(画线)

作者: sbill | 来源:发表于2017-04-03 21:14 被阅读0次
import matplotlib.pyplot as plt

input_values = [1, 2, 3, 4, 5]
squares = [1, 4, 9, 16, 25]
plt.plot(input_values, squares, linewidth=5)  #绘图 

#设置标题,给坐标轴加上标签
plt.title('Squares', fontsize=24)
plt.xlabel('Value', fontsize=14)
plt.ylabel('Squares of value', fontsize=14)

#设置刻度标记的大小
plt.tick_params(axis='both', labelsize=14)#刻度的样式

plt.show()  #显示出来
Paste_Image.png

相关文章

网友评论

      本文标题:matplotlib的简单实用(画线)

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