How to actually use export_fig?

149 visualizaciones (últimos 30 días)
jan mischke
jan mischke el 2 de Nov. de 2015
Editada: James Richard el 20 de Oct. de 2019
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 comentarios
Walter Roberson
Walter Roberson el 10 de Feb. de 2019
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
Walter Roberson el 10 de Feb. de 2019
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.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Nov. de 2015
"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 comentarios
Lingling Fan
Lingling Fan el 25 de Jul. de 2019
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
Walter Roberson el 25 de Jul. de 2019
Sounds like you did not use pathtool to add the directory to your MATLAB path.

Iniciar sesión para comentar.

Más respuestas (1)

James Richard
James Richard el 20 de Oct. de 2019
Editada: James Richard el 20 de Oct. de 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.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by