Matlab,如何调整图形上的轴值(科学通告-精度不足) [英] Matlab, how to adjust axis values on figures (scientific notaiton - not enough precision)

查看:119
本文介绍了Matlab,如何调整图形上的轴值(科学通告-精度不足)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
禁止图形刻度中的指数格式

Possible Duplicate:
Suppress exponential formatting in figure ticks

Matlab在我的图形中为每个刻度线将我的轴标记输出为5.777 x10 ^ 6 ...是否有可能使matlab输出实际的十进制数字而不是科学计数法,因此刻度线实际上是不同的值,而不是全部5.777?目前,我真的不知道这些图在空间中的什么位置,因为轴的精度不足.

Matlab is outputting my axis markers as 5.777 x10^6 for every tick mark in my figures... is it possible to get matlab to output the actual decimal number rather than scientific notation so the tick marks are actually different values rather than all 5.777? Currently I don't really know where in space these plots are because of a lack of precision on the axis.

推荐答案

一种可能的解决方案:

plot(rand(100,1).*1e6)
set(gca, 'YTickLabel', num2str(get(gca,'YTick')','%d'))

显然,您可以根据自己的喜好自定义格式

Obviously you can customize the formatting to your liking

x轴刻度的另一个示例.在这种情况下,标签会相互重叠.一种可能的解决方案是使用文件交换中的 XTICKLABEL_ROTATE 函数.

Another example for the x-axis ticks. In this case, the labels would overlap each other. One possible solution is to use the XTICKLABEL_ROTATE function from the File Exchange.

plot(5.77*1e6:5.77*1e6+9, rand(1,10))
set(gca, 'XTickLabel', num2str(get(gca,'XTick')','%d'))  %#'
xticklabel_rotate([],45)                  %# rotate the xtick-labels 45 degrees

这篇关于Matlab,如何调整图形上的轴值(科学通告-精度不足)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆