[Pythonmac-SIG] matplotlib vector graphics

Samuel M. Smith smithsm at samuelsmith.org
Fri Sep 2 16:13:42 CEST 2005


I just started using matplotlib a couple of weeks ago. And it will  
generate .ps files.
  I am using matplotlib 0.83.2 with python 2.41 framework on 10.4.2  
but I have problems
with the font definitions in the .ps or .eps files. When I try to  
convert them to .pdf I get an error
in distiller, preview, and epstopdf.

If I don't have any text on the plot then it doesn't have the error  
and converts fine. I had the same problem
with matplotlib 0.82

Anyone here successfully converted the matplotlib .ps files to .pdf?

I would like to know how to get mine to work. I don't know if it is a  
configuration problem or if
the postscript font definition code is broken on os x.

I just posted this on the matplotlib user group as well.


On 02 Sep, 2005, at 07:54, Christian Meesters 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
>>
>>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>

**********************************************************************
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84043
801-768-2768 voice
801-768-2769 fax
**********************************************************************
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**********************************************************************



More information about the Pythonmac-SIG mailing list