|
From: Steve C. <ste...@ya...> - 2005-03-18 07:15:11
|
On Thu, 2005-03-17 at 17:16 -0600, John Hunter wrote:
> >>>>> "Steve" == Steve Chaplin <ste...@ya...> writes:
>
> Steve> This looks incomplete, what's the Exception type? I tried
> Steve> on my system and it ran OK.
>
>
> Oops, the complete traceback is below. Maybe my cairo is out of
> whack. Are you using CVS?
Yes, I'm using CVS. Cairo is currently undergoing rapid development so
one day CVS may compile, the next day it may not, and the day after it
may be fixed and working again. PyCairo will be constantly lagging
behind, trying to keep up with all the changes. Periodically cairo does
a snapshot release and I intend to do a pycairo snapshot release that is
synchronised to cairo snapshot.
The most recent releases are the cairo 0.4.0 and pycairo 0.4.0 snapshots
which should compile OK and work together.
> ### Cairo backend traceback
> peds-pc311:~/python/projects/matplotlib/examples> python simple_plot.py -dCairo
> Traceback (most recent call last):
> File "simple_plot.py", line 15, in ?
> savefig('simple_plot')
> File "/usr/local/lib/python2.3/site-packages/matplotlib/pylab.py", line 712, in savefig
> return fig.savefig(*args, **kwargs)
> File "/usr/local/lib/python2.3/site-packages/matplotlib/figure.py", line 457, in savefig
> self.canvas.print_figure(*args, **kwargs)
> File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_cairo.py", line 647, in print_figure
> orientation)
> File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_cairo.py", line 561, in print_figure_fn
> if ext == 'png': _save_png (figure, fileObject)
> File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_cairo.py", line 583, in _save_png
> ctx.set_target_png (fileObject, cairo.FORMAT_ARGB32, width, height)
> TypeError: Context.set_target_png() argument 1 must be string, not file
> peds-pc311:~/python/projects/matplotlib/examples>
This looks like an old pycairo version which took a filename (str) instead of a fileobject for set_target_png()
Steve
|