怎么让matlab坐标轴纵轴只显示整数,如何强制matplotlib在Y轴上仅显示整数

在数据分析中,为了使信息更具意义,作者希望在matplotlib图表的Y轴上只显示整数值,而非小数。通过设置图表的Y轴限制、调整格式化器,以及禁用偏移量,实现了Y轴只显示整数的效果。代码中展示了如何在循环绘制子图时应用这些设置。
摘要由CSDN通过智能技术生成

我所看到的数据只有当它是整数时才有意义。

就我所分析的信息的上下文而言,0.2的记录是没有意义的。

如何强制matplotlib只在Y轴上使用整数。一、 e.1、100、5等?不是0.1,0.2等for a in account_list:

f = plt.figure()

f.set_figheight(20)

f.set_figwidth(20)

f.sharex = True

f.sharey=True

left = 0.125 # the left side of the subplots of the figure

right = 0.9 # the right side of the subplots of the figure

bottom = 0.1 # the bottom of the subplots of the figure

top = 0.9 # the top of the subplots of the figure

wspace = 0.2 # the amount of width reserved for blank space between subplots

hspace = .8 # the amount of height reserved for white space between subplots

subplots_adjust(left=left, right=right, bottom=bottom, top=top, wspace=wspace, hspace=hspace)

count = 1

for h in headings:

sorted_data[sorted_

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值