I want to put fig files as subplots
3 ビュー (過去 30 日間)
古いコメントを表示
I have four different .fig files, which I want to display in one figure with individual fig files as subplots. ALthough their xlimits are same, ylims are different.
Can you please figure out what is wrong with the following code?
h1 = openfig('PPT5.fig','reuse'); % open figure
ax1 = gca; % get handle to axes of figure
h2 = openfig('PPT14.fig','reuse');
ax2 = gca;
h3 = openfig('PPT2.fig','reuse'); % open figure
ax3 = gca; % get handle to axes of figure
h4 = openfig('ACC12.fig','reuse');
ax4 = gca;
% test1.fig and test2.fig are the names of the figure files which you would % like to copy into multiple subplots
h5 = figure; %create new figure
s1 = subplot(4,1,1); %create and get handle to the subplot axes
s2 = subplot(4,1,2);
s3 = subplot(4,1,3); %create and get handle to the subplot axes
s4 = subplot(4,1,4);
fig1 = get(ax1,'children'); %get handle to all the children in the figure
fig2 = get(ax2,'children');
fig3 = get(ax3,'children');
fig4 = get(ax4,'children');
copyobj(fig1,s1); %copy children to new parent axes i.e. the subplot axes
copyobj(fig2,s2);
copyobj(fig2,s3);
copyobj(fig2,s4);
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!