加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

【原创】更改Matlab 坐标轴标注成科学计数法 + 移动指数到坐标轴上方

(2014-08-22 22:51:08)
标签:

股票

%% ***********************[Random Test]***********************

%*******************[Change Matlab axis label to Exponential + move the exponet above the axis]*********************************

plot([0 1],[0 .02])

oldLabels = str2num(get(gca,'YTickLabel'));

scale = 10^2;newLabels = num2str(oldLabels*scale);

set(gca,'YTickLabel',newLabels,'units','normalized');

posAxes = get(gca,'position');

textBox = annotation('textbox','linestyle','none','string',['x 10\it^{' sprintf('%0.2f',log10(1./scale)) '}']);

posAn = get(textBox,'position');

set(textBox,'position',[posAxes(1) posAxes(2)+posAxes(4) posAn(3) posAn(4)],'VerticalAlignment','cap');

%% ***********************[Random Test]***********************

 

 

Src link: http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/112386

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有