[Pythonmac-SIG] matplotlib vector graphics

Teemu Rinne Teemu.Rinne at helsinki.fi
Fri Sep 2 23:27:39 CEST 2005


Thanks Christian, it does work, on one Mac out of three... 

It works on my laptop with matplotlib and stuff installed several months
ago.
It does not work on a Panther G5 with a newly installed matplotlib
(pythonmac).
It does not work on an out-of-the box Tiger with matplotlib (pythonmac)
installed.


"It works" means that the test script (below) runs ok and the ps file (144
K) behaves as expected. 
"Does not work" means that  the script runs but produces a 4.4 M (!) file
which looks ok but cannot be opened (preview, ghostscript). 

Maybe something in addition to  the pythomac matplotlib package is needed
(maybe I already have this missing package somewhere in the sediments of my
laptop) for PS to behave nicely. What? Any other ideas?


--
Teemu


--On Friday, September 2, 2005 3:54 PM +0200 Christian Meesters
<meesters at uni-mainz.de> wrote:

> Hi Teemu,
> 
> Sure, why not? It works like in the examples provided with matplotlib.
> For Example:
> 	
> 	import matplotlib
> 	matplotlib.use('Agg')
> 	import pylab
> 	
> 	pylab.plot(list1,list2,'k-')
> 	pylab.title("some title")
> 	pylab.xlabel('some unit label')
> 	pylab.ylabel('some different unit label')
> 	
> 	pylab.savefig("filename.ps")
> 
> Note though, that you need to set matplotlib.use under such circumstances
> to 'Agg', for otherwise matplotlib will complain when importing pylab
> that you (as I presume) don't have gtk, which is the default backend. You
> can use the rc-parameterfile as well and don't have to change these
> settings in every script.
> 
> Hope I could help.
> 
> Cheers,
> Christian
> 
> On 2 Sep 2005, at 15:41, Teemu Rinne wrote:
> 
>> Hi,
>> 
>> Can the vector based backends (PS or SVG) be used on OS X? If so, could
>> someone provide examples.
>> 
>> I am using the binary package (Panther) from pythonmac
>> 
>> 
>> --
>> Teemu Rinne
>> Dept Psych
>> Univ Helsinki
>> _______________________________________________
>> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
>> http://mail.python.org/mailman/listinfo/pythonmac-sig
>> 
> 




More information about the Pythonmac-SIG mailing list