MATLAB provides a function subplot () that merges multiple. Fig files by calling the subplot () function to merge multiple. Fig files into a large. Fig file. How it works: subplot divides the canvas into a grid, by specifying the location of each of the sub-fig files and merging multiple sub-fig elements into a large fig. This function is commonly used in the following ways: subplot (m, N, p), m for the number of rows in the grid, N for the number of columns in the grid, and p for the position of the child fig file in the grid. For example, M = 3, n = 2, different p values are shown in the following figure:
The complete code is as follows:
H1 = Openfig (' 1.fig ', ' reuse ');
Ax1 = GCA; H2 = Openfig (' 2.fig ', ' reuse '); % Open Figure ax2 = GCA;
% get handle to axes of figure H3 = Openfig (' 3.fig ', ' reuse ');
AX3 = GCA;
h4 = Openfig ('. 4.fig ', ' reuse ');
ax4 = GCA; h5 = Openfig (' 5.fig ', ' reuse '); % Open Figure ax5 = GCA; % get handle to axes of figure h6 = Openfig (' 6.fig ', ' reuse '); % Open Figure ax6 = GCA; % get handle to axes of figure H7 = figure; %create new Figure S1 = subplot (2,3,1);
%create and get handle to the subplot axes s2 = subplot (2,3,2); S3 = subplot (2,3,3);
%create and get handle to the subplot axes S4 = subplot (2,3,4); S5 = subplot (2,3,5);
%create and get handle to the subplot axes S6 = subplot (2,3,6); FIG1 = Get (ax1, ' children ');
%get handle to all the children in the figure Fig2 = Get (ax2, ' children '); Fig3 = Get (ax3, ' children ');
%get handle to all the children in the figure fig4 = Get (ax4, ' children '); Fig5 = Get (ax5, ' children ');
%get handle to all the children in the figure Fig6 = Get (ax6, ' children '); Copyobj (FIG1,S1);
%copy children to new parent axes i.e. the subplot axes copyobj (FIG2,S2); Copyobj (FIG3,S3);
%copy children to new parent axes i.e. the subplot axes copyobj (FIG4,S4); Copyobj (FIG5,S5);
%copy children to new parent axes i.e. the subplot axes copyobj (FIG6,S6);