contour demos fail

Hi all.

The contour plot demos are failing on my installation with a
"ValueError: Arguments x, y, z, mask (if present) must be 2D arrays."

Anyone know what's up?

Thanks.
--Craig

···

---------------------------
Traceback (most recent call last):
   File "pcolor_demo.py", line 23, in ?
     colorbar()
   File "/dat/c1/cmaloney/usr/local/lib/python2.3/site-packages/matplotlib/pylab.py", line 368, in colorbar
     edgecolor=edgecolor)
   File "/dat/c1/cmaloney/usr/local/lib/python2.3/site-packages/matplotlib/figure.py", line 767, in colorbar
     CS = cax.contourf(*args, **kw)
   File "/dat/c1/cmaloney/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line 1271, in contourf
     return ContourSet(self, *args, **kwargs)
   File "/dat/c1/cmaloney/usr/local/lib/python2.3/site-packages/matplotlib/contour.py", line 433, in __init__
     C = _contour.Cntr(x, y, z.filled(), ma.getmaskorNone(z))
ValueError: Arguments x, y, z, mask (if present) must be 2D arrays.

Craig: I assume you are using numpy? If so, you need the latest
matplotlib (0.86.2) - there may even be a few fixes committed to CVS to
fix numpy support that didn't make it in to 0.86.2. The latest CVS
version works well with numpy.

-Jeff

···

On Wed, 8 Feb 2006 21:17:51 -0800, "Craig Maloney" <cmaloney@...973...> said:

Hi all.

The contour plot demos are failing on my installation with a
"ValueError: Arguments x, y, z, mask (if present) must be 2D arrays."

Anyone know what's up?

Thanks.
--Craig

------
Jeffrey S. Whitaker
Phone: (303)497-6313
FAX: (303)497-6449
NOAA/OAR/CDC R/CDC1
325 Broadway, Boulder, CO, USA 80305-3328
http://www.cdc.noaa.gov/people/jeffrey.s.whitaker

I'd like to use Numeric-23.1 since that's what I have installed.

Will that not work with matplotlib?

Thanks,
Craig

···

On Feb 9, 2006, at 4:53 AM, Jeff Whitaker wrote:

On Wed, 8 Feb 2006 21:17:51 -0800, "Craig Maloney" > <cmaloney@...973...> said:

Hi all.

The contour plot demos are failing on my installation with a
"ValueError: Arguments x, y, z, mask (if present) must be 2D arrays."

Anyone know what's up?

Thanks.
--Craig

Craig: I assume you are using numpy? If so, you need the latest
matplotlib (0.86.2) - there may even be a few fixes committed to CVS to
fix numpy support that didn't make it in to 0.86.2. The latest CVS
version works well with numpy.

-Jeff
------
Jeffrey S. Whitaker
Phone: (303)497-6313
FAX: (303)497-6449
NOAA/OAR/CDC R/CDC1
325 Broadway, Boulder, CO, USA 80305-3328
http://www.cdc.noaa.gov/people/jeffrey.s.whitaker

Craig Maloney wrote:

I'd like to use Numeric-23.1 since that's what I have installed.

Will that not work with matplotlib?

Thanks,
Craig

Craig: That should work. Do you have numerix='Numeric' in your matplotlibrc?

You might want to upgrade to Numeric 24.2, but I don't think this is the source of your problem.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Thanks, Jeff.

That did the trick. I didn't even have a .matplotlibrc file. Default behavior must be numpy, huh?

--Craig

···

On Feb 9, 2006, at 10:03 AM, Jeff Whitaker wrote:

Craig Maloney wrote:

I'd like to use Numeric-23.1 since that's what I have installed.
Will that not work with matplotlib?
Thanks,
Craig

Craig: That should work. Do you have numerix='Numeric' in your matplotlibrc?

You might want to upgrade to Numeric 24.2, but I don't think this is the source of your problem.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Craig Maloney wrote:

Thanks, Jeff.

That did the trick. I didn't even have a .matplotlibrc file. Default behavior must be numpy, huh?

--Craig

Craig:

If you have numpy installed, it will choose that as the default. If numpy is not installed, Numeric is the default.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Bizarre. I don't remember ever having installed numpy, it doesn't appear to be anywhere on my system, and if I do an "import numpy" it fails. Maybe matplotlib is getting confused somehow? How does it try to detect if numpy is installed?

···

On Feb 9, 2006, at 10:12 AM, Jeff Whitaker wrote:

Craig Maloney wrote:

Thanks, Jeff.
That did the trick. I didn't even have a .matplotlibrc file. Default behavior must be numpy, huh?
--Craig

Craig:

If you have numpy installed, it will choose that as the default. If numpy is not installed, Numeric is the default.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Hi Jeff, et.al.

Funny thing... somehow during the process of installation and moving stuff around, matplotlib has gone back to using numpy instead of Numeric (and giving me the error messages when trying to run contour_demo.py).

I still have
"numerix : Numeric # Numeric or numarray"
in my .rc file.

How can I check to make sure about which .rc file matplotlib is trying to use?

Thanks, Craig

···

-------------------------------
Python 2.3.3 (#2, Jan 9 2004, 13:37:22)
[GCC 3.0.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylab import *
>>>
>>> rcParams['tick.direction'] = 'out'
>>>
>>> delta = 0.025
>>> x = arange(-3.0, 3.0, delta)
>>> y = arange(-2.0, 2.0, delta)
>>> X, Y = meshgrid(x, y)
>>> Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
>>> Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
>>> # difference of Gaussians
... Z = 10.0 * (Z2 - Z1)
>>>
...
>>> type(X)
<class 'numarray.numarraycore.NumArray'>
------------------------------------------------------

PS apparently, numpy *is* installed somewhere, I guess....

On Feb 9, 2006, at 10:12 AM, Jeff Whitaker wrote:

Craig Maloney wrote:

Thanks, Jeff.
That did the trick. I didn't even have a .matplotlibrc file. Default behavior must be numpy, huh?
--Craig

Craig:

If you have numpy installed, it will choose that as the default. If numpy is not installed, Numeric is the default.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

*doh*

There's not supposed to be a "dot" in the rc filename...

Works again.

--Craig

···

On Feb 9, 2006, at 11:44 AM, Craig Maloney wrote:

Hi Jeff, et.al.

Funny thing... somehow during the process of installation and moving stuff around, matplotlib has gone back to using numpy instead of Numeric (and giving me the error messages when trying to run contour_demo.py).

I still have
"numerix : Numeric # Numeric or numarray"
in my .rc file.

How can I check to make sure about which .rc file matplotlib is trying to use?

Thanks, Craig

-------------------------------
Python 2.3.3 (#2, Jan 9 2004, 13:37:22)
[GCC 3.0.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylab import *
>>>
>>> rcParams['tick.direction'] = 'out'
>>>
>>> delta = 0.025
>>> x = arange(-3.0, 3.0, delta)
>>> y = arange(-2.0, 2.0, delta)
>>> X, Y = meshgrid(x, y)
>>> Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
>>> Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
>>> # difference of Gaussians
... Z = 10.0 * (Z2 - Z1)
>>>
...
>>> type(X)
<class 'numarray.numarraycore.NumArray'>
------------------------------------------------------

PS apparently, numpy *is* installed somewhere, I guess....

On Feb 9, 2006, at 10:12 AM, Jeff Whitaker wrote:

Craig Maloney wrote:

Thanks, Jeff.
That did the trick. I didn't even have a .matplotlibrc file. Default behavior must be numpy, huh?
--Craig

Craig:

If you have numpy installed, it will choose that as the default. If numpy is not installed, Numeric is the default.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users