PS Output from WXAGG / wxPython application

savefig(*args, **kwargs)
SAVEFIG(fname, dpi=150, facecolor='w', edgecolor='w',
    orientation='portrait'):

    Save the current figure to filename fname. dpi is the resolution
    in dots per inch.

    Output file types currently supported are jpeg and png and will be
    deduced by the extension to fname

I agree that is a little misleading, but keep reading:

   orientation is either 'landscape' or 'portrait' - not supported on
   all backends; currently only on postscript output.

savefig works for ps and eps, I use it all the time without changing backends.

Ok I tried that out and I am able to save ps files without doing any backend switching.
Thanks for the tip!

Also I guess I'm not clear if saving to PS/EPS format actually creates a
line drawing/ vector image or
just creates a bitmap and encapsulates the bitmap in the PS/EPS format.
I'm looking to
be able to save as a line drawing or vector-type format.

I dont think it is a bitmap, but I will let someone more knowledgable speak to
that.

Can anyone confirm or deny this? It seems to me that it is saving out in a rasterized version
encapsulated in the postscript format. I tried saving a simple plot in both PNG and PS format -
the PNG is 77 kb and the PS is 623 kb. The plot only has 3 curves and a legend so I'm
guessing its being rasterized in the PS format.

I guess my real question is: is it possible to save a matplotlib plot in a vector-based format?

Thanks,

Eli

> I dont think it is a bitmap, but I will let someone more
> knowledgable speak to that.

Can anyone confirm or deny this? It seems to me that it is
saving out in a rasterized version encapsulated in the
postscript format. I tried saving a simple plot in both PNG
and PS format - the PNG is 77 kb and the PS is 623 kb. The
plot only has 3 curves and a legend so I'm guessing its being
rasterized in the PS format.

I guess my real question is: is it possible to save a
matplotlib plot in a vector-based format?

It does not save a bitmap of the image to a postscript file, but
normal postscript commands. The eps file is relatively large
(at least compared to png) because it includes a large but fixed
amount of font data. Try adding another line to your plot or
otherwise changing the contents of the plot, and you'll see size
of the eps file change.

Cheers,

--Matt

I guess my real question is: is it possible to save a matplotlib plot in a vector-based format?

Sure, saving as ".svg" works just fine for me...

···

Thanks,

Eli

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users