[Numpy-tickets] [NumPy] #481: Inconsistency between "plot"-like commands and the "getp" command
NumPy
numpy-tickets@scipy....
Mon Mar 26 14:40:50 CDT 2007
#481: Inconsistency between "plot"-like commands and the "getp" command
----------------------+-----------------------------------------------------
Reporter: jbmichel | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: Other | Version:
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
The following piece of code does not work:
p = plot(whatever)
getp(p, anyProperty)
The reason for this is that the getp function is tailored to take as an
input an instance of, say, Line2D, but the command "plot" produces a list
of such objects.
2 solutions:
1. Take this into account, and run the command
p = plot(whatever)
getp(p[0], anyProperty)
2. Modify the getp code at line 416 and use
func = getattr(o[0], 'get_' + name)
instead of
func = getattr(o, 'get_' + name)
JB
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/481>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list