在 Matlab 绘图的刻度标签中删除科学记数法 [英] Removing scientific notation in the tick label of a Matlab plot

查看:34
本文介绍了在 Matlab 绘图的刻度标签中删除科学记数法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Matlab 中做了一个绘图,使用:

I have made a plot in Matlab, using:

hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off

但是,y 轴上的刻度标签是以科学计数法生成的:

However, the tick labels on the y axis are generated in scientific notation:

有什么方法可以删除科学记数法,只让 y 标签的范围从 -0.0025 到 0.0005?谢谢!

Is there any way I can remove the scientific notation and just have the y labels range from -0.0025 to 0.0005? Thanks!

推荐答案

您可以尝试使用 sprintf 自己手动设置刻度标签:

You could try to manually set the tick labels yourself using sprintf:

yt = get(gca,'YTick');
set(gca,'YTickLabel', sprintf('%.4f|',yt))

这篇关于在 Matlab 绘图的刻度标签中删除科学记数法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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