声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 6570|回复: 16

[绘图技巧] xlabel里面的物理量用斜体,单位用正体?

[复制链接]
发表于 2009-11-11 22:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
例如xlabel要标注的内容是f/Hz,f为斜体,Hz为正体该怎莫实现?另外要把matlab出来的图像保存成什莫格式可以放在ps中编辑一下labels,然后再导出为什莫格式,图像质量比较好呢?(word中用),谢谢!
回复
分享到:

使用道具 举报

发表于 2009-11-12 01:07 | 显示全部楼层
plot(rand(5,1)); xlabel('\itf\rm/Hz')

ps是什么? postscript?
 楼主| 发表于 2009-11-12 19:30 | 显示全部楼层

回复 沙发 ChaChing 的帖子

photoshop
发表于 2009-11-12 23:55 | 显示全部楼层

回复 板凳 vib 的帖子

个人水平有限, 这个不清楚了! 个人较随意兜试下各格式, 喜欢就用了
同待高人路过
发表于 2009-11-13 01:31 | 显示全部楼层
 楼主| 发表于 2009-11-15 19:51 | 显示全部楼层

回复 沙发 ChaChing 的帖子

谢谢chaching:
像\it这种命令还是保留字在帮助中哪里可以找到?有没有一个表,或者集中介绍label中字符格式和大小的资料,因为有时候期刊对这方面有要求,
发表于 2009-11-15 20:28 | 显示全部楼层

回复 6楼 vib 的帖子

搜一下Text Properties! 里头string就有!
or 8F/13F of
http://forum.vibunion.com/forum/thread-48993-1-2.html
发表于 2012-3-18 11:09 | 显示全部楼层
  1. subplot(2,2,1);
  2. plot(x,kesi1_A,'-r','linewidth',1.0);
  3. hold on;
  4. plot(x1,kesi1_S_NHS,'o','markerfacecolor','w','linewidth',0.5);
  5. hold on;
  6. plot(x1,kesi1_S_HS,'.k','markersize',16);
  7. set(gca,'FontName','Times New Roman');
  8. xlabel('\itx\rm/m','FontSize',15,'FontName','Times New Roman');
  9. ylabel('\it\eta\rm/m','FontSize',15,'FontName','Times New Roman');
  10. set(gca,'YLim',[-0.1,1.1],'XLim',[0,300]);
  11. set(gca,'XTickLabel',[0:50:300],'fontsize',13,'FontName','Times New Roman');
  12. set(gca,'YTickLabel',[0:0.2:1],'fontsize',13,'FontName','Times New Roman');
  13. h=legend('右侧','中间','左侧');
  14. set(h,'Fontsize',20);
  15. legend('boxoff');
  16. legend(gca,'Orientation','vertical','location','northeast');
  17. legend boxoff;
  18. text(135,1.0,'\fontname{Times New Roman}\fontsize{19} t=5 s');
复制代码

——————————————————————————————————
上面是我的代码,为什么我用句柄控制legend的字体大小,没有作用呢?不管我改成多少,字体大小总也不变?可否帮我看一下,到底是什么问题?
发表于 2012-3-19 00:43 | 显示全部楼层
回复 8 # mastergxm 的帖子

LS指的是这行吗? set(h,'Fontsize',20);
试了下, 没问题的!
但版本间是否有差异, 就不确定了!
建议LS直接get(h)看看h是否有该属性
发表于 2012-3-20 15:41 | 显示全部楼层
回复 9 # ChaChing 的帖子

我用的是7.1,运行没有效果。
发表于 2012-3-21 00:23 | 显示全部楼层
回复 10 # mastergxm 的帖子

有没get(h)看看h是否有该属性
发表于 2012-4-15 10:52 | 显示全部楼层
回复 11 # ChaChing 的帖子

有个图例的问题想请教你。
plot(t1,U1_A,'-r','linewidth',1.0);
hold on;
plot(t2,U1_S,'o','markerfacecolor','w','linewidth',0.5);
hold on;
plot(t1,U6_A,'-r','linewidth',1.0);
hold on;
plot(t2,U6_S,'o','markerfacecolor','w','linewidth',0.5);
hold on;
plot(t1,U10_A,'-r','linewidth',1.0);
hold on;
plot(t2,U10_S,'o','markerfacecolor','w','linewidth',0.5);
legend('解析解','模拟值');
legend('boxoff');legend(gca,'Orientation','horizontal');
legend boxoff;
这是我的代码,代码中总共画了三条实线(第1行,第5行,第9行)和三条symbol线(第3行,第7行,第11行)。其中实线代表解析解,点线代表模拟值,我想画出图例,只用说明实线表示解析解,symbol线表示模拟值,但是用上面的代码画的效果是这样的
未命名.jpg
而我只想显示了前面那两个,不要后面的data3,data4,data5,data6这四个,请问可有什么方法?
发表于 2012-4-15 11:36 | 显示全部楼层
回复 12 # mastergxm 的帖子

看看这些, 里头应该有答案, 不行再说
9.如何对图形的图例进行分栏 http://forum.vibunion.com/thread-84520-1-1.html
   如何让Legend显示为两行? http://forum.simwe.com/thread-334715-1-1.html
   多个legend以及标注部分图列构成多列图列 http://genial.ycool.com/post.138255.html
   请问legend 指令怎么改变顺序 http://forum.vibunion.com/thread-73381-1-1.html
   如何将两个曲线的图例合并 http://forum.vibunion.com/thread-103395-1-1.html
from http://forum.vibunion.com/home-s ... -blog-id-18250.html
发表于 2012-4-15 15:52 | 显示全部楼层
回复 13 # ChaChing 的帖子

这里面我都看了,没有类似的问题。不知你有没有办法呀?
发表于 2012-4-16 00:54 | 显示全部楼层
回复 14 # mastergxm 的帖子

没有类似的问题!?:@)
7F, 请问legend 指令怎么改变顺序 http://forum.vibunion.com/thread-73381-1-1.html
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-6-20 03:54 , Processed in 0.065018 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表