Mathematica中文论坛-非官方

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 6192|回复: 0
打印 上一主题 下一主题

豆粑粑 matlab 图中图。

[复制链接]

532

主题

602

帖子

3031

积分

论坛元老

Rank: 8Rank: 8

积分
3031
跳转到指定楼层
楼主
发表于 2016-8-17 10:27:05 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式


这是在fileexchange里找到的,应该是挺有用的。

  1. % Create data
  2. t = linspace(0,2*pi);
  3. t(1) = eps;
  4. y = sin(t);

  5. % Place axes at (0.1,0.1) with width and height of 0.8
  6. figure
  7. handaxes1 = axes('Position', [0.12 0.12 0.8 0.8]);

  8. % Main plot
  9. plot(t, y)
  10. xlabel('t')
  11. ylabel('sin(t)')
  12. set(handaxes1, 'Box', 'off')

  13. % Adjust XY label font
  14. handxlabel1 = get(gca, 'XLabel');
  15. set(handxlabel1, 'FontSize', 16, 'FontWeight', 'bold')
  16. handylabel1 = get(gca, 'ylabel');
  17. set(handylabel1, 'FontSize', 16, 'FontWeight', 'bold')

  18. % Place second set of axes on same plot
  19. handaxes2 = axes('Position', [0.6 0.6 0.2 0.2]);
  20. fill(t, y.^2, 'g')
  21. set(handaxes2, 'Box', 'off')
  22. xlabel('t')
  23. ylabel('(sin(t))^2')

  24. % Adjust XY label font
  25. set(get(handaxes2, 'XLabel'), 'FontName', 'Times')
  26. set(get(handaxes2, 'YLabel'), 'FontName', 'Times')

  27. % Add another set of axes
  28. handaxes3 = axes('Position', [0.25 0.25 0.2 0.2]);
  29. plot(t, y.^3)
  30. set(handaxes3, 'Box','off')
  31. xlabel('t')
  32. ylabel('(sin(t))^3')
复制代码


fig_in_fig.png (86.79 KB, 下载次数: 864)

fig_in_fig.png
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Mathematica中文论坛-非官方 ( 辽ICP备16001491号-1

GMT+8, 2024-4-29 00:40 , Processed in 0.121542 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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