large postscript files

Hi,

The following plot

from numarray import *
x = arange(80000)
from pylab import plot,show
plot(x,x)
show()

and saving in postscript format generated a file of 1.5MB, while the equivalent is
only 288KB in xmgrace (another plotting program). If I use plot(x,x,"k,"), this
even leads to a horrible 8.0MB. How come? I understand there is an issue
with the fonts, but this can't be the only responsible, can it? Plotting no points,
just a title, and saving in postscript leads to a file size of only 133KB.

FWIW, I'm trying to make postscript plots using Python 2.4.1, latest numarray,
and matplotlib 0.83.2.

Cheers,
Joris

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

I cannot help you with making matplotlib create smaller files but sam2p is an image
conversion program that creates small files. You might be able to
convert your file to make it smaller.

Bill

wrote:

···

joris@…1253…


Hi,
The following plot
from numarray import *
x = arange(80000)
from pylab import plot,show
plot(x,x)
show()

and saving in postscript format generated a file of 1.5MB, while the equivalent is only 288KB in xmgrace (another plotting program). If I use plot(x,x,"k,"), this
even leads to a horrible 8.0MB. How come? I understand there is an issue with the fonts, but this can't be the only responsible, can it? Plotting no points, just a title, and saving in postscript leads to a file size of only 133KB.
FWIW, I'm trying to make postscript plots using Python 2.4.1, latest numarray, and matplotlib 0.83.2.
Cheers,
Joris
Disclaimer: -------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
_______________________________________________
Matplotlib-users mailing list

http://www.kuleuven.be/cwis/email_disclaimer.htmhttp://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642Matplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users

Is there a method of using the show() command more
than once in a script? I know that it should be
called once all commands have been entered for the
graph, but I'm wondering if there is a way of
resetting this so that I can call show() a second time
without my program crashing.

Thanks,
Matt

···

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Each data point consists of a line like

54.3869 28.6788 l

which is 17 bytes long. 17*80000 = 1.36MB. Maybe we dont need as many sig
figs, that could cut the size down by maybe 25%.

Darren

···

On Wednesday 06 September 2006 07:49, joris@...1253... wrote:

Hi,

The following plot

>>> from numarray import *
>>> x = arange(80000)
>>> from pylab import plot,show
>>> plot(x,x)
>>> show()

and saving in postscript format generated a file of 1.5MB, while the
equivalent is only 288KB in xmgrace (another plotting program). If I use
plot(x,x,"k,"), this even leads to a horrible 8.0MB. How come? I understand
there is an issue with the fonts, but this can't be the only responsible,
can it? Plotting no points, just a title, and saving in postscript leads to
a file size of only 133KB.

FWIW, I'm trying to make postscript plots using Python 2.4.1, latest
numarray, and matplotlib 0.83.2.

Another things that can be good to add is a better clipping. For the moment
there are no clipping that means if I have something like::

x = arange(1000)
plot(x,x)
xlim(30,40)
savefig('test.svg')

All the point are stored in the file, not only the part between 30 and 40.

This is something I spoke before and I fill a bug or feature request on
sourceforge (I'have been unable to find it today but I looked fast).

You can check the problem with the svg created if you open it with inkscape,
you'll see all the point. I understood that this is a bug inside inkscape too
butthat means that all the point are there and it's a big concern for me when
I have to plot plenty of spectra and use only a small range because I know
that my file at the end will be huge. The only way I found is 1) save in png
and use another software to save it in eps but I loose the fact that eps is a
vectoriel format 2) do the clipping myself or 3) create my plot with another
software like pgplot or gnuplot.

···

Le mercredi 6 septembre 2006 09:49, Darren Dale a écrit :

On Wednesday 06 September 2006 07:49, joris@...1253... wrote:
> Hi,
>
> The following plot
>
> >>> from numarray import *
> >>> x = arange(80000)
> >>> from pylab import plot,show
> >>> plot(x,x)
> >>> show()
>
> and saving in postscript format generated a file of 1.5MB, while the
> equivalent is only 288KB in xmgrace (another plotting program). If I use
> plot(x,x,"k,"), this even leads to a horrible 8.0MB. How come? I
> understand there is an issue with the fonts, but this can't be the only
> responsible, can it? Plotting no points, just a title, and saving in
> postscript leads to a file size of only 133KB.
>
> FWIW, I'm trying to make postscript plots using Python 2.4.1, latest
> numarray, and matplotlib 0.83.2.

Each data point consists of a line like

54.3869 28.6788 l

which is 17 bytes long. 17*80000 = 1.36MB. Maybe we dont need as many sig
figs, that could cut the size down by maybe 25%.

Darren