CocoaAgg backend seems to be broken

Hi all,

I was trying matplotlib 0.98.0 and Qt4 backend works great but Coca
backend seems to be broken :

Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from scipy import lena
import matplotlib
matplotlib.use("CocoaAgg")
import pylab
pylab.imshow(lena())

<matplotlib.image.AxesImage object at 0x2ac0a10>

pylab.show()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_cocoaagg.py",
line 46, in show
    manager.show()
  File "/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_cocoaagg.py",
line 205, in show
    NSApplication.sharedApplication().run()
  File "/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_cocoaagg.py",
line 181, in startWithBundle_
    if not bundle.loadNibFile_externalNameTable_withZone_('Matplotlib.nib',
{}, None):
  File "/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_cocoaagg.py",
line 88, in awakeFromNib
    self.plotView.windowDidResize_(self)
  File "/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_cocoaagg.py",
line 137, in windowDidResize_
    dpi = self.canvas.figure.dpi.get()
AttributeError: 'int' object has no attribute 'get'

Any ideas?

Regards,
ismail

···

--
Never learn by your mistakes, if you do you may never dare to try again.

Charlie,

any chance you can try and port cocoaagg over to the new trunk api.
figure.dpi is no longer a lazy value, but a plain ol number. There
are probably a few other changes that will need to be made as well.
I'd like to clear up as many of these problems as we can and shoot for
a bugfix release next week.

JDH

···

On Thu, Jun 12, 2008 at 2:58 PM, İsmail Dönmez <ismail@...2037...> wrote:

Hi all,

I was trying matplotlib 0.98.0 and Qt4 backend works great but Coca
backend seems to be broken :

I am out of town and won’t be able to address this until early next week.

  • Charlie

2008/6/12 John Hunter <jdh2358@…287…>:

···

On Thu, Jun 12, 2008 at 2:58 PM, İsmail Dönmez <ismail@…2037…> wrote:

Hi all,

I was trying matplotlib 0.98.0 and Qt4 backend works great but Coca

backend seems to be broken :

Charlie,

any chance you can try and port cocoaagg over to the new trunk api.

figure.dpi is no longer a lazy value, but a plain ol number. There

are probably a few other changes that will need to be made as well.

I’d like to clear up as many of these problems as we can and shoot for

a bugfix release next week.

JDH

Seems like that one little fix did the trick. I ran several examples and haven't had any problems. Committed now.

- Charlie

···

On Jun 12, 2008, at 4:27 PM, John Hunter wrote:

On Thu, Jun 12, 2008 at 2:58 PM, İsmail Dönmez <ismail@...2053.....> > wrote:

Hi all,

I was trying matplotlib 0.98.0 and Qt4 backend works great but Coca
backend seems to be broken :

Charlie,

any chance you can try and port cocoaagg over to the new trunk api.
figure.dpi is no longer a lazy value, but a plain ol number. There
are probably a few other changes that will need to be made as well.
I'd like to clear up as many of these problems as we can and shoot for
a bugfix release next week.

JDH

Thanks Charlie! Can you provide some basic instructions for those of
us on osx how we can enable and test this backend?

JDH

···

On Thu, Jun 19, 2008 at 9:19 PM, Charles Moad <cwmoad@...287...> wrote:

Seems like that one little fix did the trick. I ran several examples and
haven't had any problems. Committed now.

I guess the two option are to set “CocoaAgg” as the default backend in your rc config or run a script with the “-dCocoaAgg” flag.

  • Charlie
···

On Thu, Jun 19, 2008 at 10:35 PM, John Hunter <jdh2358@…287…> wrote:

On Thu, Jun 19, 2008 at 9:19 PM, Charles Moad <cwmoad@…287…> wrote:

Seems like that one little fix did the trick. I ran several examples and

haven’t had any problems. Committed now.

Thanks Charlie! Can you provide some basic instructions for those of

us on osx how we can enable and test this backend?

Works fine for me with Matplotlib 0.98.2. Thanks for the fix.

Regards,
ismail

···

On Mon, Jun 23, 2008 at 6:52 PM, Charlie Moad <cwmoad@...287...> wrote:

On Thu, Jun 19, 2008 at 10:35 PM, John Hunter <jdh2358@...287...> wrote:

On Thu, Jun 19, 2008 at 9:19 PM, Charles Moad <cwmoad@...287...> wrote:

> Seems like that one little fix did the trick. I ran several examples
> and
> haven't had any problems. Committed now.

Thanks Charlie! Can you provide some basic instructions for those of
us on osx how we can enable and test this backend?

I guess the two option are to set "CocoaAgg" as the default backend in your
rc config or run a script with the "-dCocoaAgg" flag.

--
Programmer Excuses number 45: I do object-oriented programming - if
the customer objects, I do more programming.