Mathematica中文论坛-非官方
标题:
豆粑粑 matlab 图中图。
[打印本页]
作者:
meatball1982
时间:
2016-8-17 10:27
标题:
豆粑粑 matlab 图中图。
这是在fileexchange里找到的,应该是挺有用的。
% Create data
t = linspace(0,2*pi);
t(1) = eps;
y = sin(t);
% Place axes at (0.1,0.1) with width and height of 0.8
figure
handaxes1 = axes('Position', [0.12 0.12 0.8 0.8]);
% Main plot
plot(t, y)
xlabel('t')
ylabel('sin(t)')
set(handaxes1, 'Box', 'off')
% Adjust XY label font
handxlabel1 = get(gca, 'XLabel');
set(handxlabel1, 'FontSize', 16, 'FontWeight', 'bold')
handylabel1 = get(gca, 'ylabel');
set(handylabel1, 'FontSize', 16, 'FontWeight', 'bold')
% Place second set of axes on same plot
handaxes2 = axes('Position', [0.6 0.6 0.2 0.2]);
fill(t, y.^2, 'g')
set(handaxes2, 'Box', 'off')
xlabel('t')
ylabel('(sin(t))^2')
% Adjust XY label font
set(get(handaxes2, 'XLabel'), 'FontName', 'Times')
set(get(handaxes2, 'YLabel'), 'FontName', 'Times')
% Add another set of axes
handaxes3 = axes('Position', [0.25 0.25 0.2 0.2]);
plot(t, y.^3)
set(handaxes3, 'Box','off')
xlabel('t')
ylabel('(sin(t))^3')
复制代码
fig_in_fig.png
(86.79 KB, 下载次数: 1527)
下载附件
2016-8-17 10:26 上传
欢迎光临 Mathematica中文论坛-非官方 (http://ilovemathematica.com/)
Powered by Discuz! X3.2