matplotlib 纵坐标轴显示数据值的实例
作者:dongyuguoai 时间:2021-10-02 12:55:43
实例如下所示:
import matplotlib as mt
import numpy as np
y=[7,0,0,0,0,0,1,25,98,333,471,0,322,429,425,478,385,237,219,284,351,364,165,0]
x=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
x1=np.asanyarray(x)
y1=np.asanyarray(y)
import matplotlib.pyplot as plt
fig=plt.figure()
ax1=fig.add_subplot(1,1,1)
ax1.bar(x1,y1)
ax1.yaxis.set_ticks(y1) #设置y轴刻度为y值
plt.show()
参考文献:matplotlib官网的docs
来源:https://blog.csdn.net/dongyuguoai/article/details/69814884
标签:matplotlib,坐标轴,数据值
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
浅谈ASP自动采集程序及入库
2007-08-17 11:25:00
python Django框架实现web端分页呈现数据
2022-07-03 03:47:14
清除浮动的最简写法
2009-03-30 15:58:00
Python实现猜数字小游戏
2022-10-09 18:38:12
![](https://img.aspxhome.com/file/2023/1/99261_0s.jpg)
Python画柱状统计图操作示例【基于matplotlib库】
2021-04-06 21:53:50
![](https://img.aspxhome.com/file/2023/2/97262_0s.png)
详解ASP中断开记录集的使用方法
2008-02-13 08:35:00
Python使用selenium + headless chrome获取网页内容的方法示例
2023-05-02 05:27:37
python多线程实现动态图绘制
2023-10-22 21:53:53
python排序算法之归并排序
2021-03-24 06:05:39
![](https://img.aspxhome.com/file/2023/7/70037_0s.jpg)
Python OpenGL绘制一场烟花盛会
2021-02-08 06:12:44
![](https://img.aspxhome.com/file/2023/7/97027_0s.png)
uniqueidentifier转换成varchar数据类型的sql语句
2011-09-30 11:17:48
Python 学习笔记
2022-06-18 07:12:31
jQuery选择器 学习总结
2008-06-15 15:41:00
基于Python实现语音合成小工具
2023-01-13 15:25:38
![](https://img.aspxhome.com/file/2023/5/98995_0s.jpg)
php注册系统和使用Xajax即时验证用户名是否被占用
2023-09-12 05:27:55
![](https://img.aspxhome.com/file/2023/4/55524_0s.png)
True or False,明明白白你的If语句流程
2008-01-25 19:00:00
Python基于递归实现电话号码映射功能示例
2023-11-15 09:38:39
python实现按键精灵找色点击功能教程,使用pywin32和Pillow库
2023-11-08 18:30:34
![](https://img.aspxhome.com/file/2023/5/63915_0s.jpg)
ThinkPHP5集成JS-SDK实现微信自定义分享功能
2023-06-10 13:59:47
Python字典和集合讲解
2021-03-05 22:31:14
![](https://img.aspxhome.com/file/2023/2/65552_0s.png)