Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1103781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:23:19+00:00 2026-05-17T01:23:19+00:00

When saving a figure, what function does Matlab use? For example, when a user

  • 0

When saving a figure, what function does Matlab use? For example, when a user selects File > Save As… and then selects .png or another image format, what is going on behind the scenes?

I am asking because I am trying to automate saving, but when I use saveas or print, the resulting image is really pixelated. However, the image looks really good when I save the figure using the method described above.

What method should I use to save my figure from the command line? The actual method that the figure window uses would work, but if you guys have better solutions, I’d appricate it!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:23:20+00:00Added an answer on May 17, 2026 at 1:23 am

    The callback for the “Save As…” menu item invokes the function FILEMENUFCN with the first input argument being the handle of the figure the menu is in and the second input argument being the string 'FileSaveAs'. If you have the figure handle stored in the variable hFigure, then the following command should be equivalent to clicking the “Save As…” menu item in that figure window:

    >> filemenufcn(hFigure,'FileSaveAs');
    

    A few notes…

    • The function FILEMENUFCN is only partially documented. You can do help filemenufcn in the command window, but there is no entry for it in the online documentation. In MATLAB 2009a, the function can be found in the following folder:

      C:\Program Files\MATLAB\R2009a\toolbox\matlab\uitools\filemenufcn.m
      

      Looking through the function code, it appears that it ultimately calls either the function SAVEAS for .fig files or the function HGEXPORT (with additional input arguments) for other file types.

    • I was able to hunt down the callback for the “Save As…” menu item by searching through the children of the figure window and its menus. You can do this yourself by setting the root property 'ShowHiddenHandles' to 'on' and then traversing through the 'Children' properties of the figure window and its menus using the GET command. An alternative is to use the FINDALL command, assuming you know some properties of the objects you are looking for. For example, this will find the handle to the “File” menu for the current figure window:

      >> hFileMenu = findall(gcf,'Label','&File');
      

      And this will find the handle to the “Save As…” menu item and display its callback:

      >> hSaveAs = findall(hFileMenu,'Label','Save &As...');
      >> get(hSaveAs,'Callback')
      ans =
      filemenufcn(gcbf,'FileSaveAs')
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Issue while saving image using savefiledialog I use windows forms in C#.
Saving a Word 2003 document to XML and then back results in a reduced
When saving a form I deactivate the save button to avoid double submission. Save
I'm saving a struct into a .dat file. Lets suppose I have to edit
The Seaside book says: saving [an image] while processing http requests is a risk
I've got my models saving and updating using the regular save with a success
I'm just trying to figure out how to create an index inside a function
I need to save some state when the user leaves my game during game
I have the following jQuery code: $('.save').submit(function(e){ var formElement = $(this); var data =
Ok so I've used function pointers for some time. I was trying to figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.