Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MNT]: Define Axes.clear semantics #28851

Open
@timhoffm

Description

@timhoffm

Summary

Axes.clear() / Axes.cla() are only documented as "Clear the Axes". What exactly "clear" means is neither documented nor well defined. We reset some stuff and keep other.

This leads to a number of issues:

There has been some inital work in #23839, but the topic is not completely solved.

Proposed fix

We need to define what clear means.

First on an abstract level: This could be a starting point:

  • All data-like content should be removed (actual data, labels, etc.)
  • Layout should stay (axes position, twinning)
  • Formatting: t.b.d.

When the high-level definition is agreed upon, we need to define what that means for concrete cases.
e.g. it's clear that we remove label content. Should label positions also be reset (e.g. if somebody has moved the xlabel to top)? - This may also depend on the anticipated use case: One wants to reuse the Axes for a new plot. How similar is it to the old plot. Does it only get new data and labels or could it be a completely different plot?

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