How to combined saved figure files in a subplot
5 ビュー (過去 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!