How can i merge three mat.fig in a single figure as subplots which has multiple axis

Hallo Everyone,
I am trying to merge three mat.fig in a single figure as subplots which has multiple axis. But when i run it using the following code all the three figures are overlapping on each other. My code is as follows:
% Load saved figures
Fig1=hgload(‘Trail1.fig’);
Fig2=hgload(‘Trail2.fig’);
Fig3=hgload(‘Trail3.fig’);

% Prepare the new figure and layout
f = figure;
t = tiledlayout(f,2,2);

% Paste figures on the tiles
child1 = copyobj(Fig1.Children, t);
child2 = copyobj(Fig2.Children, t);
child3 = copyobj(Fig3.Children, t);
ax1 = findobj(child1, ‘type’, ‘axes’);

ax2 = findobj(child2, ‘type’, ‘axes’);
ax2.Layout.Tile = 2; % Move the axes to the right tile.

ax3 = findobj(child3, ‘type’, ‘axes’);
ax3.Layout.Tile = 3; % Move the axes to the right tile.

% manually set the Colormap property of "Axes" in each panel
ax1.Colormap = Fig1.Colormap;
ax2.Colormap = Fig2.Colormap;
ax3.Colormap = Fig3.Colormap;
I am attaching the code and the .fig files. Thanks in advance.
With regardsHallo Everyone,
I am trying to merge three mat.fig in a single figure as subplots which has multiple axis. But when i run it using the following code all the three figures are overlapping on each other. My code is as follows:
% Load saved figures
Fig1=hgload(‘Trail1.fig’);
Fig2=hgload(‘Trail2.fig’);
Fig3=hgload(‘Trail3.fig’);

% Prepare the new figure and layout
f = figure;
t = tiledlayout(f,2,2);

% Paste figures on the tiles
child1 = copyobj(Fig1.Children, t);
child2 = copyobj(Fig2.Children, t);
child3 = copyobj(Fig3.Children, t);
ax1 = findobj(child1, ‘type’, ‘axes’);

ax2 = findobj(child2, ‘type’, ‘axes’);
ax2.Layout.Tile = 2; % Move the axes to the right tile.

ax3 = findobj(child3, ‘type’, ‘axes’);
ax3.Layout.Tile = 3; % Move the axes to the right tile.

% manually set the Colormap property of "Axes" in each panel
ax1.Colormap = Fig1.Colormap;
ax2.Colormap = Fig2.Colormap;
ax3.Colormap = Fig3.Colormap;
I am attaching the code and the .fig files. Thanks in advance.
With regards Hallo Everyone,
I am trying to merge three mat.fig in a single figure as subplots which has multiple axis. But when i run it using the following code all the three figures are overlapping on each other. My code is as follows:
% Load saved figures
Fig1=hgload(‘Trail1.fig’);
Fig2=hgload(‘Trail2.fig’);
Fig3=hgload(‘Trail3.fig’);

% Prepare the new figure and layout
f = figure;
t = tiledlayout(f,2,2);

% Paste figures on the tiles
child1 = copyobj(Fig1.Children, t);
child2 = copyobj(Fig2.Children, t);
child3 = copyobj(Fig3.Children, t);
ax1 = findobj(child1, ‘type’, ‘axes’);

ax2 = findobj(child2, ‘type’, ‘axes’);
ax2.Layout.Tile = 2; % Move the axes to the right tile.

ax3 = findobj(child3, ‘type’, ‘axes’);
ax3.Layout.Tile = 3; % Move the axes to the right tile.

% manually set the Colormap property of "Axes" in each panel
ax1.Colormap = Fig1.Colormap;
ax2.Colormap = Fig2.Colormap;
ax3.Colormap = Fig3.Colormap;
I am attaching the code and the .fig files. Thanks in advance.
With regards plot, subplot, matfig MATLAB Answers — New Questions

​

Leave a Reply

Your email address will not be published. Required fields are marked *