Save Graphs in MATLAB with Zoom & Scroll

  • Context: MATLAB 
  • Thread starter Thread starter dpsguy
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary

Discussion Overview

The discussion revolves around the challenges of saving complex graphs created in MATLAB, particularly focusing on preserving zoom and scroll functionality when exporting to formats like PDF or BMP. Participants explore various file formats and software options for achieving better detail and usability in saved images.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes that saving graphs as PDFs results in a "screenshot" that does not support zooming, raising the question of how to save the graph in a more usable format.
  • Another participant suggests that vector graphics file types like .ai and .eps may preserve detail, but they also mention that these formats only save what appears on the screen.
  • Some participants discuss the inability to open .ai files in Adobe Reader and suggest ensuring compatibility when saving these files.
  • There is mention of Google Docs supporting .eps format, but one participant finds no significant difference compared to PDF format.
  • Inkscape and GIMP are recommended as free software options for opening and manipulating .eps files, with Inkscape being highlighted for further image manipulation.
  • Another participant mentions ghostscript/ghostview as tools for opening .eps files and suggests using PDFCreator to convert .eps to PDF, questioning whether the output would be in vector or bitmap format.
  • A participant shares their own solution of using Gephi for network visualization, expressing frustration over MATLAB's lack of a specialized toolbox for this purpose.

Areas of Agreement / Disagreement

Participants express various viewpoints on the effectiveness of different file formats and software for preserving graph details, indicating that multiple competing views remain without a clear consensus on the best solution.

Contextual Notes

Limitations include the dependency on specific software capabilities and the unresolved nature of how different formats handle zoom and scroll functionalities.

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 [itex]\LaTeX[/itex]:
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 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K