MATLAB:堆叠.figs

时间:2013-03-05 12:06:11

标签: matlab graph plot stacked-area-chart

我目前正在研究燃料消耗。我有多个.fig文件,显示L / 100 Km与时间相比的燃料消耗趋势。我有多个案例显示了不同条件下情节的行为,我不想显示它们之间的差异。情节的一个例子如下所示:

enter image description here

无论如何在1 .fig文件中堆叠来自不同.fig文件的图?

1 个答案:

答案 0 :(得分:0)

理想情况下,您希望使用subplot生成不同的图表。

ZiV在mathworks forums

中回答了您的确切问题
  

执行此操作的一种方法是从现有提取xdata和ydata   数字,然后根据需要在新的数字窗口中重新绘制这些数据。   例如,

open('gugu.fig');
h_gugu=get(gca,'Children');
x_gugu=get(h_gugu,'XData');
y_gugu=get(h_gugu,'YData');

open('lulu.fig');
h_lulu=get(gca,'Children');
x_lulu=get(h_lulu,'XData');
y_lulu=get(h_lulu,'YData');

figure
subplot(121)
plot(x_gugu,y_gugu);
subplot(122)
plot(x_lulu,y_lulu)
saveas(gcf,'gugululu','fig')