Skip to content

[MNT]: Analyse, define and document Artist.axes #31118

@timhoffm

Description

@timhoffm

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions