rgrids and thetagrids raise AttributeError and TypeError

I was playing around with polar plots and trying to alter the grid labels when I ran into some weird errors. Whenever I call pyplot.thetagrids() (and similarly with rgrids) I get:

>>> AttributeError: ‘PolarAxesSubplot’ object has no attribute 'thetagridlines

After searching the MPL directory, it didn’t seem like thetagridlines was defined anywhere. Alternatively, If I call thetagrids with an argument [e.g. thetagrids(range(45,360,90))], I get

>>> TypeError: ‘NoneType’ object is not iterable

which comes from the following line in pyplot:

lines, labels = ax.set_thetagrids(*args, **kwargs)

Strangely, the set_thetagrids method of PolarAxes doesn’t return any values and this is causing the TypeError above.

I’m really confused about these errors. Any help would be greatly appreciated.

-Tony

PS: Full tracebacks are shown below.

I’m on MPL trunk, r5588.

CASE 1:

···

Traceback (most recent call last):

File “polar.py”, line 19, in

lines, labels = thetagrids()

File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/pyplot.py”, line 984, in thetagrids

lines = ax.thetagridlines()

AttributeError: ‘PolarAxesSubplot’ object has no attribute ‘thetagridlines’

CASE 2:


Traceback (most recent call last):

File “polar.py”, line 19, in

lines, labels = thetagrids(range(45,360,90))

File “/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/pyplot.py”, line 987, in thetagrids

lines, labels = ax.set_thetagrids(*args, **kwargs)

TypeError: ‘NoneType’ object is not iterable

That's a bug created by not updating thetagrids and rgrids after the recent transformation refactoring.

I believe it is not fixed in r5594. Can you update and let me know if you're still having trouble?

Thanks,
Mike

Tony Yu wrote:

···

I was playing around with polar plots and trying to alter the grid labels when I ran into some weird errors. Whenever I call pyplot.thetagrids() (and similarly with rgrids) I get:

*>>> AttributeError:* 'PolarAxesSubplot' object has no attribute 'thetagridlines

After searching the MPL directory, it didn't seem like thetagridlines was defined anywhere. Alternatively, If I call thetagrids with an argument [e.g. thetagrids(range(45,360,90))], I get

*>>> TypeError:* 'NoneType' object is not iterable

which comes from the following line in pyplot:

>>> lines, labels = ax.set_thetagrids(*args, **kwargs)

Strangely, the set_thetagrids method of PolarAxes doesn't return any values and this is causing the TypeError above.

I'm really confused about these errors. Any help would be greatly appreciated.

-Tony

PS: Full tracebacks are shown below. I'm on MPL trunk, r5588.

CASE 1:
------------
Traceback (most recent call last):
  File "polar.py", line 19, in <module>
    lines, labels = thetagrids()
  File "/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/pyplot.py", line 984, in thetagrids
    lines = ax.thetagridlines()
AttributeError: 'PolarAxesSubplot' object has no attribute 'thetagridlines'

CASE 2:
------------
Traceback (most recent call last):
  File "polar.py", line 19, in <module>
    lines, labels = thetagrids(range(45,360,90))
  File "/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/pyplot.py", line 987, in thetagrids
    lines, labels = ax.set_thetagrids(*args, **kwargs)
TypeError: 'NoneType' object is not iterable

------------------------------------------------------------------------

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
------------------------------------------------------------------------

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi Mike,

I just updated to r5595 and both rgrids and thetagrids work perfectly.

Thanks for your help.
-Tony

···

On Jun 19, 2008, at 9:24 AM, Michael Droettboom wrote:

That's a bug created by not updating thetagrids and rgrids after the recent transformation refactoring.

I believe it is not fixed in r5594. Can you update and let me know if you're still having trouble?

Thanks,
Mike

Tony Yu wrote:

I was playing around with polar plots and trying to alter the grid labels when I ran into some weird errors. Whenever I call pyplot.thetagrids() (and similarly with rgrids) I get:

*>>> AttributeError:* 'PolarAxesSubplot' object has no attribute 'thetagridlines

After searching the MPL directory, it didn't seem like thetagridlines was defined anywhere. Alternatively, If I call thetagrids with an argument [e.g. thetagrids(range(45,360,90))], I get

*>>> TypeError:* 'NoneType' object is not iterable

which comes from the following line in pyplot:

>>> lines, labels = ax.set_thetagrids(*args, **kwargs)

Strangely, the set_thetagrids method of PolarAxes doesn't return any values and this is causing the TypeError above.

I'm really confused about these errors. Any help would be greatly appreciated.

-Tony

PS: Full tracebacks are shown below. I'm on MPL trunk, r5588.

CASE 1:
------------
Traceback (most recent call last):
File "polar.py", line 19, in <module>
   lines, labels = thetagrids()
File "/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/pyplot.py", line 984, in thetagrids
   lines = ax.thetagridlines()
AttributeError: 'PolarAxesSubplot' object has no attribute 'thetagridlines'

CASE 2:
------------
Traceback (most recent call last):
File "polar.py", line 19, in <module>
   lines, labels = thetagrids(range(45,360,90))
File "/Users/Tony/python/matplotlib/trunk/matplotlib/lib/matplotlib/pyplot.py", line 987, in thetagrids
   lines, labels = ax.set_thetagrids(*args, **kwargs)
TypeError: 'NoneType' object is not iterable

------------------------------------------------------------------------

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
------------------------------------------------------------------------

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

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