bug in cm.py

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

Thanks. I have corrected this in SVN.

Cheers,
Mike

Vincent Schut wrote:

···

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Thanks.
However, now I get a different error:

Traceback (most recent call last):
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 331, in expose_event
    self._render_figure(self._pixmap, w, h)
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 319, in _render_figure
    self.figure.draw (self._renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/figure.py", line
622, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line
1297, in draw
    im.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
188, in draw
    im = self.make_image(renderer.get_image_magnification())
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
130, in make_image
    x = self.to_rgba(self._A, self._alpha)
  File "/usr/lib64/python2.5/site-packages/matplotlib/cm.py", line 61,
in to_rgba
    m, n = npy.shape[:2]
TypeError: 'function' object is unsubscriptable

Michael Droettboom wrote:

···

Thanks. I have corrected this in SVN.

Cheers,
Mike

Vincent Schut wrote:

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@...1455...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Can you send your script that triggers this bug? I wasn't the author of this code, so I don't know how to get that path to execute -- but I'm happy to work through your example until it's working.

(I suspect the intention here was "m, n = x.shape[:2]", but I can't test it.)

Cheers,
Mike

Vincent Schut wrote:

···

Thanks.
However, now I get a different error:

Traceback (most recent call last):
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 331, in expose_event
    self._render_figure(self._pixmap, w, h)
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 319, in _render_figure
    self.figure.draw (self._renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/figure.py", line
622, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line
1297, in draw
    im.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
188, in draw
    im = self.make_image(renderer.get_image_magnification())
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
130, in make_image
    x = self.to_rgba(self._A, self._alpha)
  File "/usr/lib64/python2.5/site-packages/matplotlib/cm.py", line 61,
in to_rgba
    m, n = npy.shape[:2]
TypeError: 'function' object is unsubscriptable

Michael Droettboom wrote:

Thanks. I have corrected this in SVN.

Cheers,
Mike

Vincent Schut wrote:

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hmm, that's a bit hard, it's not really what one would call a
self-contained example...

the bug triggers when I load a rgb numpy float array with imshow (only
with floats, not with ints).

After some thought and trial, it's simple: these lines already trigger
the error:

···

#======================
import pylab, numpy

rgbFloat = numpy.random.random((100,100,3))
pylab.imshow(rgbFloat)
pylab.show()
#======================

Hope that helps!

VS.

Michael Droettboom wrote:

Can you send your script that triggers this bug? I wasn't the author of
this code, so I don't know how to get that path to execute -- but I'm
happy to work through your example until it's working.

(I suspect the intention here was "m, n = x.shape[:2]", but I can't test
it.)

Cheers,
Mike

Vincent Schut wrote:

Thanks.
However, now I get a different error:

Traceback (most recent call last):
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 331, in expose_event
    self._render_figure(self._pixmap, w, h)
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 319, in _render_figure
    self.figure.draw (self._renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/figure.py", line
622, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line
1297, in draw
    im.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
188, in draw
    im = self.make_image(renderer.get_image_magnification())
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
130, in make_image
    x = self.to_rgba(self._A, self._alpha)
  File "/usr/lib64/python2.5/site-packages/matplotlib/cm.py", line 61,
in to_rgba
    m, n = npy.shape[:2]
TypeError: 'function' object is unsubscriptable

Michael Droettboom wrote:

Thanks. I have corrected this in SVN.

Cheers,
Mike

Vincent Schut wrote:

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@...1455...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@...1455...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks, that helps a lot.

It seems to be working now -- I've committed this in r4643.

Cheers,
Mike

Vincent Schut wrote:

···

Hmm, that's a bit hard, it's not really what one would call a
self-contained example...

the bug triggers when I load a rgb numpy float array with imshow (only
with floats, not with ints).

After some thought and trial, it's simple: these lines already trigger
the error:

#======================
import pylab, numpy

rgbFloat = numpy.random.random((100,100,3))
pylab.imshow(rgbFloat)
pylab.show()
#======================

Hope that helps!

VS.

Michael Droettboom wrote:

Can you send your script that triggers this bug? I wasn't the author of this code, so I don't know how to get that path to execute -- but I'm happy to work through your example until it's working.

(I suspect the intention here was "m, n = x.shape[:2]", but I can't test it.)

Cheers,
Mike

Vincent Schut wrote:

Thanks.
However, now I get a different error:

Traceback (most recent call last):
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 331, in expose_event
    self._render_figure(self._pixmap, w, h)
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 319, in _render_figure
    self.figure.draw (self._renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/figure.py", line
622, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line
1297, in draw
    im.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
188, in draw
    im = self.make_image(renderer.get_image_magnification())
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
130, in make_image
    x = self.to_rgba(self._A, self._alpha)
  File "/usr/lib64/python2.5/site-packages/matplotlib/cm.py", line 61,
in to_rgba
    m, n = npy.shape[:2]
TypeError: 'function' object is unsubscriptable

Michael Droettboom wrote:

Thanks. I have corrected this in SVN.

Cheers,
Mike

Vincent Schut wrote:

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Mike,

Thanks for fixing those two errors that I introduced in 4374. I'm sorry that I evidently did not test that code path, or even inspect it carefully.

Eric

Michael Droettboom wrote:

···

Thanks, that helps a lot.

It seems to be working now -- I've committed this in r4643.

Cheers,
Mike

Vincent Schut wrote:

Hmm, that's a bit hard, it's not really what one would call a
self-contained example...

the bug triggers when I load a rgb numpy float array with imshow (only
with floats, not with ints).

After some thought and trial, it's simple: these lines already trigger
the error:

#======================
import pylab, numpy

rgbFloat = numpy.random.random((100,100,3))
pylab.imshow(rgbFloat)
pylab.show()
#======================

Hope that helps!

VS.

Michael Droettboom wrote:

Can you send your script that triggers this bug? I wasn't the author of this code, so I don't know how to get that path to execute -- but I'm happy to work through your example until it's working.

(I suspect the intention here was "m, n = x.shape[:2]", but I can't test it.)

Cheers,
Mike

Vincent Schut wrote:

Thanks.
However, now I get a different error:

Traceback (most recent call last):
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 331, in expose_event
    self._render_figure(self._pixmap, w, h)
  File
"/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 319, in _render_figure
    self.figure.draw (self._renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/figure.py", line
622, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line
1297, in draw
    im.draw(renderer)
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
188, in draw
    im = self.make_image(renderer.get_image_magnification())
  File "/usr/lib64/python2.5/site-packages/matplotlib/image.py", line
130, in make_image
    x = self.to_rgba(self._A, self._alpha)
  File "/usr/lib64/python2.5/site-packages/matplotlib/cm.py", line 61,
in to_rgba
    m, n = npy.shape[:2]
TypeError: 'function' object is unsubscriptable

Michael Droettboom wrote:

Thanks. I have corrected this in SVN.

Cheers,
Mike

Vincent Schut wrote:

Hi,

there is a bug in cm.py (svn): it references npy (first time: line 58),
but npy is never imported.

Cheers,
VS.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Michael Droettboom wrote:

Thanks, that helps a lot.

It seems to be working now -- I've committed this in r4643.

Cheers,
Mike

Mike, thanks a lot for the rapid action! Bugs squashed.

Cheers,
Vincent.