How to actually use export_fig? (2024)

227 views (last 30 days)

Show older comments

jan mischke on 2 Nov 2015

  • Link

    Direct link to this question

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig

  • Link

    Direct link to this question

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig

Edited: James Richard on 20 Oct 2019

Accepted Answer: Walter Roberson

How does the export_fig function work? I always get the hint to use the File Exchange and this function if I want to get high resolution pictures from my plots, but there is not a single word on how to actually use it. So everyone talks about it like you already know everything about it :( I am quite new to matlab. Do I just unzip it and copy all files in my directory of my script and then? Do I need to change something? Can someone help me with this or at least give me a link to a README that explains on how to use such functions? Thank you

3 Comments

Show 1 older commentHide 1 older comment

ding hoang on 10 Feb 2019

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_669693

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_669693

Haha: This is so true ! Typical gadgets online...I got 2018b matlab and tried to run App Designer to plot the functions, which I have written already on version 2015b - impossible !! I will not start to re-write the program all over again...

seriously...for the light of the day I cannot find any instruction on how to save the plots (multiple plots) from my programs. I saved the figures using the save figure command in .bmp format and it worked fine, until I tried to open the file, then windows 10 said it cannot open the files. long story short, now i'm stucked with a bunch of more scripts with no instruction of how to run it...

I must said, there are plenty of people here are very helpful - thank you very much !!

Walter Roberson on 10 Feb 2019

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_669713

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_669713

App Designer is based on new graphics methods that did not exist in r2015b. The graphics it uses is based on web figures, so html and css and the like, with no use of java at all . Some of the old graphics properties do not exist or have to change form , so fundamentals such as figures and axes are different for App Designer . Older code requires adjustment for use with App Designer .

But you can continue to create gui with guide.

Walter Roberson on 10 Feb 2019

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_669714

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_669714

I find information that the default Windows 10 image viewer is not able to display aa number of different image types but that it is possible to switch back.

Sign in to comment.

Sign in to answer this question.

Accepted Answer

Walter Roberson on 2 Nov 2015

  • Link

    Direct link to this answer

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#answer_198229

  • Link

    Direct link to this answer

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#answer_198229

Open in MATLAB Online

http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig

"Usage examples and tips can be found in the README section at: https://github.com/altmany/export_fig/blob/master/README.md"

To use it, go to the link in the file exchange and click on the Download link. Save the .zip file somewhere. Unzip the .zip into a separate directory in a convenient location. Then go into MATLAB and use the command

pathtool

and add the directory to the MATLAB path.

After that, you call it like any function that can be used in command or function mode.

5 Comments

Show 3 older commentsHide 3 older comments

MengXing Na on 24 Nov 2017

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_508459

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_508459

Thanks a lot.

Avinash Kumar on 13 Oct 2018

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_621826

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_621826

Thank a lot for very accurate answer Walter Robenson.

Xiaoming Zhang on 26 Mar 2019

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_685756

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_685756

Thanks a lot.

Lingling Fan on 25 Jul 2019

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_728261

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_728261

To Walter Robenson: Thanks

I have one question: after all the path add-things are done, the MATLAB can run export_fig 123.png&fig&jpg.... But when it runs export_fig 123.pdf, it says: no ghostscript.m. But it is in the same file as the imported installation folder. What should I do?

Thank you in advance!

Walter Roberson on 25 Jul 2019

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_728282

  • Link

    Direct link to this comment

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#comment_728282

Sounds like you did not use pathtool to add the directory to your MATLAB path.

Sign in to comment.

More Answers (1)

James Richard on 20 Oct 2019

  • Link

    Direct link to this answer

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#answer_397285

  • Link

    Direct link to this answer

    https://www.mathworks.com/matlabcentral/answers/252411-how-to-actually-use-export_fig#answer_397285

Edited: James Richard on 20 Oct 2019

The organized ways I think is to use the built-in Add-On Explorer itself.

  1. In MATLAB, open Preferences
  2. Navigate to MATLAB>Add-Ons
  3. Choose any directory that you would like it. It's one directory for all add-ons.
  4. Click OK
  5. Now, open Add-On Explorer
  6. Search "export_fig", then open it
  7. Click "Add from GitHub"
  8. It will ask you to sign in first, if you haven't.
  9. Then click OK

Don't forget to install Ghostscript and pdftops (part of the Xpdf command line tools) if you haven't.

And you're done.

Locating Ghostscript/pdftops - You may find a dialogue box appears when using export_fig, asking you to locate either Ghostscript or pdftops (part of the Xpdf package). These are separate applications which export_fig requires to perform certain functions. If such a dialogue appears it is because export_fig can't find the application automatically. This is because you either haven't installed it, or it isn't in the normal place. Make sure you install the applications correctly first. They can be downloaded from the following places:

  1. Ghostscript: www.ghostscript.com
  2. pdftops (install the Xpdf package): www.xpdfreader.com

If you choose to install them in a non-default location then point export_fig to this location using the dialogue box.

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Sign in to answer this question.

See Also

Categories

SciencesPsychologyPsychtoolbox-3: Vision and neuroscience researchTiming and presenting 2D and 3D stimuli

Find more on Timing and presenting 2D and 3D stimuli in Help Center and File Exchange

Tags

  • export_fig

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


How to actually use export_fig? (12)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

Contact your local office

How to actually use export_fig? (2024)

References

Top Articles
Latest Posts
Article information

Author: Stevie Stamm

Last Updated:

Views: 6284

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.