The method of saving axes as vector graph in MATLAB GUI program design

Source: Internet
Author: User

When MATLAB is designed for GUI programming, a figure typically contains multiple axes controls.

Common instructions for saving vectors the SaveAs and print can only save the picture in figures, not one of the axes in the figure.

While the Getframe+imwrite method can save axes, but can only be saved as a bitmap, can not be saved as a vector image, it must cause the loss of detail information.

A solution is given below.

Create a new, invisible figure and axes, copy the axes content you want to save to the new axes, and save the new figure.

Since there are only 1 axes in the new figure, it is equivalent to saving a axes.

H=get (handles.axes1, ' Children '); figure (' visible ', ' off '); Axes;copyobj (H,GCA); SaveAs (Gcf,filename, ' EMF ');

The method of saving axes as vector graph in MATLAB GUI program design

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.