matplotlib 纵坐标轴显示数据值的实例
2018-05-25 10:43
435 查看
实例如下所示:
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
以上这篇matplotlib 纵坐标轴显示数据值的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- matplotlib 纵坐标轴显示数据值
- 对python中Matplotlib的坐标轴的坐标区间的设定实例讲解
- 【Matplotlib】线设置,坐标显示范围
- Python 利用matplotlib绘制热力图 correlation heatmap X,Y 坐标轴字体重叠显示问题,将字体进行旋转
- python—matplotlib数据可视化实例注解系列-----之plot图线型设置
- 【Matplotlib】数据可视化实例分析
- tkinter+matplotlib实现示波器效果,动态显示汽车数据
- python matplotlib绘图,修改坐标轴刻度为文字的实例
- python—matplotlib数据可视化实例注解系列-----之柱状图
- python—matplotlib数据可视化实例注解系列-----之横条图
- 【Matplotlib】数据可视化实例分析
- python—matplotlib数据可视化实例注解系列-----之函数图
- matplotlib的二维数据显示
- matplotlib模块数据可视化-设置次坐标轴
- matplotlib——坐标负数显示问题Unicode minus
- python—matplotlib数据可视化实例注解系列-----之箱状图
- matplotlib模块数据可视化-设置坐标轴
- matplotlib中文坐标轴和标题显示
- 【Matplotlib】数据可视化实例分析
- matplotlib 显示图片鼠标所指位置的坐标