数据可视化(一) 线条曲线

import matplotlib.pyplot as plt

input_values = [1,2,3,4,5]
squares = [1,4,9,16,25]

#设置线条的坐标值和宽度
# plt.plot(squares,linewidth=5)
plt.plot(input_values,squares,linewidth=5)

#设置图标标题,并给坐标轴加上标签
plt.title("Square Numbers",fontsize=24)
plt.xlabel("Value",fontsize=14)
plt.ylabel("Square of Value",fontsize=14)

#设置刻度标记的大小
plt.tick_params(axis='both',labelsize=10)
#显示图标
plt.show()

图标如下:

 
原文地址:https://www.cnblogs.com/zzl112893/p/9868235.html