Matlab merges multiple. Fig files

Source: Internet
Author: User

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);



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.