How to combined saved figure files in a subplot
4 次查看(过去 30 天)
显示 更早的评论
I have two matlab .figure file
Now want to plot these two figures into a single subplot
i have use this code
%First Figure
h1 = openfig('ba-da CS Cz.fig','reuse'); % open figure
ax1 = gca; % get handle to axes of figure
%Second Figure
h2 = openfig('ba-da CS Fz.fig','reuse');
ax2 = gca;
%third new figure
h3 = figure; %create new figure
s1 = subplot(1,2,1); %create and get handle to the subplot axes
ylim([0 50]);
s2 = subplot(1,2,2);
ylim([0 50]);
fig1 = get(ax1,'children'); %get handle to all the children in the figure
fig2 = get(ax2,'children');
copyobj(fig1,s1); %copy children to new parent axes i.e. the subplot axes
copyobj(fig2,s2);
but the x-axis for both subplot seems shifted from the original individual figure.
anybody can advice on the idea to resolve this.? Many thanks
2 个评论
Sudheer Bhimireddy
2020-8-4
From the figures shown, it doesn't look like the x-axis for Fig 1,2 starts at 0. To verify, check the axis limits from the figure XData.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!