Message Boards Message Boards

Exporting 3D plots, with low size

Posted 9 years ago

I have plotted few 3D graphs using the command "ListPlot3D" (Say Graph1)

And then I am Expoting them using command : Export["G1.eps", Graph1]

This exports the 3D graph "Graph1" to file "G1.eps"

Now The problem arises is that, the size of exported file "G1.eps" is very high. Near about 10 MB.

I need this file to have size, as small as possible.

Please see into it. Kindly suggest the solution. Thanks in advance.

POSTED BY: abhishek sharma
4 Replies

EPS is a notoriously large format, and there's no point using it for this because ListPlot3Ds can't be exported as vector graphics anyways. Try a raster format like Export["G1.png", Graph1] or Export["G1.jpg", Graph1].

POSTED BY: Jesse Friedman

okie... thanks

POSTED BY: abhishek sharma
Posted 9 years ago

EPS is a notoriously large format, and there's no point using it for this because ListPlot3Ds can't be exported as vector graphics anyways.

Actually this is not true: for example, evaluating the following in version 10.2 produces a EPS file of size 66 Kb without any raster:

pl = ListPlot3D[{{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}}, Mesh -> All];
Export["pl.eps", pl]

I do not think 66 Kb EPS can be considered as a large file, especially If we take into consideration that Mathematica's EPS Export does not apply any compression which EPS format supports. As a comparison Exporting into PNG with good (but not excellent) resolution 300 dpi produces a file of size 136 Kb:

Export["pl.png", pl, ImageResolution -> 300]

In version 10 we face the fact that vector Exporting of 3D plots into PDF is disabled by default and even explicit setting of option AllowRasterization -> False does not work. I hope that it is a bug which will be fixed.

POSTED BY: Alexey Popkov
Posted 9 years ago

Now The problem arises is that, the size of exported file "G1.eps" is very high. Near about 10 MB.

In such situation the best what can be done is to rasterize only the plot itself, keeping axes and labels in vector form. This problem was investigated for the first time by StackOverfow participant jmlopez and me in the thread "Rasters in 3D graphics." A solution for Mathematica 7 was developed. The proposed approach was further developed by Mathematica.SE participant halirutan in this answer. Note the huge number of upvotes: this functionality is highly appreciated by the community!

POSTED BY: Alexey Popkov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract