MATLAB Save Graphs in MATLAB with Zoom & Scroll

  • Thread starter Thread starter dpsguy
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
Creating graphs in MATLAB with over 2000 nodes can lead to visual overlap, making it challenging to save clear images. Users have noted that exporting to formats like PDF, AI, or EPS often results in losing the ability to zoom or scroll, as these formats typically capture only what is visible on the screen. Alternatives such as saving as .fig files retain all details but require reopening in MATLAB. Free software like Inkscape and GIMP can open EPS files, while PDFCreator can convert EPS to PDF. Ultimately, one user found success using Gephi for network visualization, highlighting a gap in MATLAB's capabilities for this purpose.
dpsguy
Messages
69
Reaction score
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?
 
Physics news on Phys.org
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.
 
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.
 
MATLABdude said:
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...?
 
MikeyW said:
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")?
 
dpsguy said:
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 \LaTeX:
http://asymptote.sourceforge.net/

EDIT: Both Inkscape and GIMP will allow you to open and work with .EPS files.
 
dpsguy said:
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:
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.
 

Similar threads

Replies
3
Views
2K
Replies
2
Views
3K
Replies
1
Views
4K
Replies
3
Views
3K
Replies
12
Views
3K
Replies
5
Views
3K
Replies
18
Views
6K
Back
Top