How to combine multiple .fig files into one .fig file?

45 次查看(过去 30 天)
I have 9 .fig files where each file has 4 figures (in 1 row x 4 col configuration) where the Y axis label remains same but X axis is different for each of the 4 figures. I have attached a sample file. I want to combine the 9 files into 1 files (of 9 rows x 1 col configuration) such that the Y axis remains only on the left most figure and the titles of the figures remain only on the top most 4 figures. I tried different codes that I have been working with for years (own and internet downloaded) but couldn't solve the issue.

回答(1 个)

Taylor
Taylor 2024-1-23
编辑:Walter Roberson 2024-2-6
  5 个评论
Taylor
Taylor 2024-2-6
Replace
% Load the first figure file
fig1 = openfig('Sample_file.fig', 'invisible');
axes1 = findobj(fig1, 'Type', 'axes');
% Load the second figure file
fig2 = openfig('Sample_file2.fig', 'invisible'); % change the name for your second file
axes2 = findobj(fig2, 'Type', 'axes');
with
% Load the first figure file
fig1 = openfig('Sample_file.fig', 'invisible');
axes1 = findobj(fig1, 'Type', 'axes');
axes1 = flip(axes1);
% Load the second figure file
fig2 = openfig('Sample_file2.fig', 'invisible'); % change the name for your second file
axes2 = findobj(fig2, 'Type', 'axes');
axes2 = flip(axes2);
Sam O'Keefe
Sam O'Keefe 2024-4-24
Whilst the flip addition does sort out the left to right numbering of the plots ref their axes and titular data, the actual plotted data position is still incorrect ref the OPs comment;
"For example, subplot 4 is placed at position 1 and 2, subplot 3 is correct, subplot 4 gives the plot that should have been at position 1. "

请先登录,再进行评论。

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by