用matplotlib绘制简单的折线

如图:

import matplotlib.pyplot as plt
//引入matplotlib.pylot,用plt来替代
input_value = [1,2,3,4,5]
//设置横坐标数值
squares = [1,4,9,16,25]
//设置纵坐标数值
plt.plot(input_value,squares,linewidth=5)
//绘制图像(输入址,输出值,线宽)
plt.title("Square Number",fontsize=24)
//设置图像title
plt.xlabel("Value",fontsize=14)
//设置横坐标的名称,文字大小
plt.ylabel("Square of Value",fontsize=14)
//同上
plt.show()
//显示图片

转载于:https://www.cnblogs.com/aprogrammerwithoutemotion/p/9079473.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值