Saving figures in Matlab

  • MATLAB
  • Thread starter dpsguy
  • Start date
  • #1
69
0
I have created a graph in MATLAB using gplot. The graph has >2000 nodes, hence there is a lot of overlap between nodes and the picture is not very clear. This is not such a big problem in MATLAB as I can zoom into the figure. But I want to save the file as a PDF. When I do this, the image is saved as a “screenshot”, which does not support zoom as it does in MATLAB. Is there any way in which I can save this graph as a PDF, or even any other format like BMP in which I can scroll or zoom the figure?
 

Answers and Replies

  • #2
MATLABdude
Science Advisor
1,655
4
I haven't done a whole lot of work exporting images from MATLAB, but the following page from the MATLAB documentation site may be of help (note that PDF is just a container, AI or EPS are usually vector format):
http://www.mathworks.com/help/techdoc/ref/saveas.html

PRO-TIP: you can often open .ai (Adobe Illustrator) files using Adobe Reader.
 
  • #3
1,233
17
To preserve detail in the figure you want to use a vector graphics file type, but even these files appear to only save what appears on your screen.

I experimented with .ai, .eps, and cannot open then in my reader. .png can be viewed, but does not store all the information.

The only way I know to store the image with all its content (including the ability to zoom) is as a .fig, which means you have to open it again in MATLAB. I'm sure there is a way to export it, but I don't know how.
 
  • #4
69
0
PRO-TIP: you can often open .ai (Adobe Illustrator) files using Adobe Reader.

From http://noahlittle.wordpress.com/2007/12/10/open-adobe-illustrator-files-with-adobe-reader/
Always check on “Create PDF Compatible FIle” when saving your “.ai” file for those you want to open in Reader later. If you don’t do this step, Ai will not embed the pdf data and Reader won’t see it either and give you an error.
Matlab does not give such an option, and I can't get the .ai file to open on Adobe reader.

But I suppose there must be some solution to my problem...?
 
  • #5
69
0
To preserve detail in the figure you want to use a vector graphics file type, but even these files appear to only save what appears on your screen.

I experimented with .ai, .eps, and cannot open then in my reader. .png can be viewed, but does not store all the information.
Google docs now supports .eps format. But I tried it out and it does not seem to be any different from the pdf format, at least on Google docs. Is there any (free) software for "properly" opening .eps files (assuming that the eps format does store "all the information")?
 
  • #6
MATLABdude
Science Advisor
1,655
4
Google docs now supports .eps format. But I tried it out and it does not seem to be any different from the pdf format, at least on Google docs. Is there any (free) software for "properly" opening .eps files (assuming that the eps format does store "all the information")?
Inkscape is a great free and open source illustration / vector graphics program (it's the F/OSS analogue of Adobe Illustrator):
http://inkscape.org/

GIMP (the GNU Image Manipulation Program) is a great retouch / raster manipulation program (it's the F/OSS analogue of Adobe Photoshop):
http://www.gimp.org/

Both should be able to open .EPS files, but Inkscape is the one to use if you need to further manipulate images. For his thesis, a friend of mine avoided MATLAB altogether, and generated his plots in GNU Plot:
http://www.gnuplot.info/

I'll also plug something that a different friend of mine worked on: Asymptote, the vector graphics language. Very flexible if you're looking to plot equations rather than datapoints, and have some experience with [itex]\LaTeX[/itex]:
http://asymptote.sourceforge.net/

EDIT: Both Inkscape and GIMP will allow you to open and work with .EPS files.
 
  • #7
131
0
Google docs now supports .eps format. But I tried it out and it does not seem to be any different from the pdf format, at least on Google docs. Is there any (free) software for "properly" opening .eps files (assuming that the eps format does store "all the information")?
ghostscript/ghostview will open eps files. PDFCreator, which uses ghostscript, should be able to convert eps to pdf. You could also try to print directly from Matlab to PDFCreator (it creates a virtual printer) without saving to eps. I'm not sure if it would "print" in vector or bitmap format.

Both programs are open source and therefore free.
 
Last edited:
  • #8
69
0
Thanks for the suggestions everyone!!

However I found my own solution to the problem- I created my network using Gephi (http://gephi.org/). Turned out to be pretty neat, though I still used Matlab to generate the .gdf files required for input.

Pity Matlab does not have a specialized toolbox for network visualization. Would have saved me a lot of hassle.
 

Related Threads on Saving figures in Matlab

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
3
Views
11K
  • Last Post
Replies
2
Views
37K
  • Last Post
Replies
5
Views
5K
  • Last Post
Replies
1
Views
698
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
4K
Replies
3
Views
3K
Replies
1
Views
3K
Top