Thread Subject: Reducing eps file size

Subject: Reducing eps file size

From: ramis

Date: 1 Apr, 2007 03:29:20

Message: 1 of 6

Hello,

I hope I am not violating any rules by reformulating my former
question (http://newsreader.mathworks.com/WebX/.ef52ae1?50@@),
hich was more "surf" related. This one is more general and I hope to
get some help. Sometimes I get extremely huge eps files, in the ordr
of 1-100 MB and I need a resolution which is acceptable, so -r300
should be a minimum. Furthermore I tried different renderers, but
they didn't reduce the files size enough and additionaly, sometimes
the eps functionality, like accessing the fonts and numbers or points
in a figure in a grafic program like photoshop or illustrater gets
lost. I searched the whole newsgroup forum and did not find any
solution.

In short: How to reduce the file size and still have access to the
eps functionalities.

Here is the code I use to generate the figure:
surf(RR, log10(FF), log10(psd/36));
shading interp

whereas, RR, FF and psd is of size: 513x33
the .fig figure is 310kb big.

Sorry again for posting a similar question, but I thought this time
it is more specific.

Subject: Reducing eps file size

From: Xiao Chen

Date: 1 Apr, 2007 11:08:17

Message: 2 of 6

You can try this software 'Origin' to plot this figure. Origin is a
powerful software in ploting. ^_^

Matlab often occurs some problems when outputting the figure file. I
always use Origin to plot, and output the figure as eps.

Xiao

Subject: Reducing eps file size

From: Michael Wild

Date: 2 Apr, 2007 09:14:31

Message: 3 of 6

Ramis wrote:
> Hello,
>
> I hope I am not violating any rules by reformulating my former
> question (http://newsreader.mathworks.com/WebX/.ef52ae1?50@@),
> hich was more "surf" related. This one is more general and I hope to
> get some help. Sometimes I get extremely huge eps files, in the ordr
> of 1-100 MB and I need a resolution which is acceptable, so -r300
> should be a minimum. Furthermore I tried different renderers, but
> they didn't reduce the files size enough and additionaly, sometimes
> the eps functionality, like accessing the fonts and numbers or points
> in a figure in a grafic program like photoshop or illustrater gets
> lost. I searched the whole newsgroup forum and did not find any
> solution.

this is because some of the renderers create vector graphics output,
others just basically embed a bitmap (pixels) into the eps. in the
latter case there is no way that graphics programs will be able to
access the elements directly (other than 'overlaying' or overwriting).

>
> In short: How to reduce the file size and still have access to the
> eps functionalities.
>

use a renderer which is able to create vector output. do not use
transparency. unfortunately, it seems that matlab does not remove hidden
parts of the graphics in the output, which in some cases can cause
considerable bloat.

try to reduce the size of the dataset used for plotting. there is no use
for data higher resolved than the actual resolution. and even then, it
most likely will be too highly resolved, as nobody will be able to tell
the difference...



michael

Subject: Reducing eps file size

From: ramis

Date: 2 Apr, 2007 04:03:39

Message: 4 of 6

>
> this is because some of the renderers create vector graphics
> output,
> others just basically embed a bitmap (pixels) into the eps. in the
> latter case there is no way that graphics programs will be able to
> access the elements directly (other than 'overlaying' or
> overwriting).
>
>>
>> In short: How to reduce the file size and still have access to
> the
>> eps functionalities.
>>
>
> use a renderer which is able to create vector output. do not use
> transparency. unfortunately, it seems that matlab does not remove
> hidden
> parts of the graphics in the output, which in some cases can cause
> considerable bloat.
>
> try to reduce the size of the dataset used for plotting. there is
> no use
> for data higher resolved than the actual resolution. and even then,
> it
> most likely will be too highly resolved, as nobody will be able to
> tell
> the difference...
>
>
>
> michael
>

Thanks you Michael,

I tried all that already, but the file size is always above few MB. I
do not need the surface plot itself as a vector plot, but the labels
as well as the axis (the ticks and the numbers). Can that be
achieved? It would certainly reduce the file size. I could of course
save the image to bitmap format and than read it in again and save,
but that does not look as nice as the original figure.

Subject: Reducing eps file size

From: Ramis Örlü

Date: 3 May, 2007 04:03:35

Message: 5 of 6

Despite my desperate search I still haven't come up with a good
solution. I have to use the painter's renderer to preserve the full
eps functionalities in order to edit text in LaTex afterwards. I
added the Matlab figure file here <http://www.mech.kth.se/~ramis/test.fig>
and I use print -f# -deps -r300 -painters filename, the result is a
very huge eps file which can't be included in LaTex or if then it
doesn't show up completely. If I use zbuffer as a renderer I can see
the whole image (still huge), but can't edit text afterwards. I am
still hoping for a solution.

Subject: Reducing eps file size

From: TV

Date: 3 May, 2007 07:58:27

Message: 6 of 6

Ramis wrote:

> I do not need the surface plot itself as a vector plot, but the
> labels as well as the axis (the ticks and the numbers). Can that
> be achieved? It would certainly reduce the file size.
  
I had the same problem a while back. I never found a good solution so
if you find one please share it here.

The more or less acceptable solution I found is mentioned in the last
post in this thread:

 <http://newsreader.mathworks.com/WebX/.ee9ce24?50@@>

It is essentially a function (figpl) that does what you describe
above. It saves the axes, labels, etc. in an eps file. The plotted
surface is saved in a tiff file. Unfortunately you have to edit both
files in order to manually overlay both saved figures.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com