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 rowsin the grid,N for the number of columns in the grid, andp for the position of thechild fig file in the grid. For example, M = 3, n = 2, different p values are as follows:


The complete code is as follows:

H1 = Openfig (' 1.fig ', ' reuse '); ax1 = GCA;H2 = Openfig (' 2.fig ', ' reuse '); % Open figureax2 = GCA; % get handle to axes of Figureh3 = Openfig (' 3.fig ', ' reuse '); ax3 = Gca;h4 = Openfig ('. 4.fig ', ' reuse '); ax4 = Gca;h5 = Openfi G (' 5.fig ', ' reuse '); % Open figureax5 = GCA; % get handle to axes of Figureh6 = Openfig (' 6.fig ', ' reuse '); % Open figureax6 = GCA; % get handle to axes of Figureh7 = figure; %create New figures1 = subplot (2,3,1); %create and get handle to the subplot Axess2 = subplot (2,3,2); s3 = subplot (2,3,3); %create and get handle to the subplot AXESS4 = subplot (2,3,4); s5 = subplot (2,3,5); %create and get handle to the subplot AXESS6 = subplot (2,3,6); fig1 = Get (ax1, ' children '); %get handle to all the children in the FIGUREFIG2 = Get (ax2, ' Children '); fig3 = Get (ax3, ' children '); %get handle to all the children in the FIGUREFIG4 = Get (ax4, ' Children '); Fig5 = Get (ax5, ' children '); %get handle to all the children in the Figurefig6 = Get (ax6, ' Children '); Copyobj (FIG1,S1); %copy children to new pareNT axes i.e. the subplot axescopyobj (FIG2,S2); Copyobj (FIG3,S3); %copy children to new parent axes i.e. the subplot axescopyobj (FIG4,S4); Copyobj (FIG5,S5); %copy children to new parent axes i.e. the subplot axescopyobj (FIG6,S6);



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Matlab merges multiple. Fig files

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.