MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   抑制数字刻度中的指数格式 (https://www.labfans.com/bbs/showthread.php?t=23824)

poster 2019-12-10 20:48

抑制数字刻度中的指数格式
 
大于大约10,000的刻度的刻度标签,例如,格式设置为1x10 ^ 4。而指数部分出现在相应轴的上方。 [URL="http://www.mathworks.com/matlabcentral/newsreader/view_thread/270088"]在Matlab[/URL] Central上也很好地描述了这种不当行为,但是没有解决方案。

谢谢你的帮助。

“快速把戏”

set(gca, 'YTickLabel',get(gca,'YTick')) 应用于bar3时不起作用,如下图所示。

[IMG]https://i.stack.imgur.com/S7Fwg.png[/IMG]



[B]回答:[/B]

更好地控制刻度标签并避免指数格式的一种方法是使用File Exchange中的[URL="http://www.mathworks.com/matlabcentral/fileexchange/16003-tick2text-create-easy-to-customize-tick-labels"]TICK2TEXT[/URL] 。

这是一个例子:

y = cool(7); %# define some data ah = axes; %# create new axes and remember handle bar3(ah,y*1E6,'detached'); %# create a 3D bar plot tick2text(ah, 'ztickoffset' ,-1.15,'zformat', '%5.0f', 'axis','z') %# fix the tick labels

[url=https://stackoverflow.com/questions/3588293]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:08

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.