Summary
The situation is currently mixed and not well-defined, e.g.
|
try: |
|
self.axes = None |
|
except AttributeError: |
|
# Handle self.axes as a read-only property, as in Figure. |
does always raise AFAICS should not be there, because Artist has an Axes property.
- Semantics: Loosely speaking Artist. axes is the Axes the Artist is in. Do we need to specify this explicitly? Who has the authority to set this? Likely only
Axes.add_artist?
- Semantics 2: Figure redefines the property to "The list of Axes in the figure"
- Some Artist subclasses define property setters
- Should Artist.axes be public at all or is it an implementation detail.
- we should have one place where we document the logic behind all this. Could e.g. be with the property.
- probably more ...
Proposed fix
No response
Summary
The situation is currently mixed and not well-defined, e.g.
matplotlib/lib/matplotlib/artist.py
Lines 215 to 218 in 45caf0e
does always raise AFAICSshould not be there, because Artist has an Axes property.Axes.add_artist?Proposed fix
No response