Skip to content

[MNT]: Add tests to codify ax.clear #23839

Closed

Description

@jklymak

Summary

As discussed on today's call.

We need to codify what ax.clear and plt.cla are meant to actually clear on an axes, versus setting on the axes that should remain static.

For instance, it is pretty straight forward that clearing an axes should remove any data artists from the plot. However, what other properties should be reset. Labels? Tick styling, grids? Units on axes? Locators and formatters? The scale of the axises?

If anyone with edit access wants, they should start a list here, or if folks don't have edit access they can add list items on the comments.

Crossref: #23808

More reference from @timhoffm (#23808 (review)):

Proposed fix

No response

Activity

  1. added this to the v3.7.0 milestone on Sep 9, 2022
  2. added
    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …
    on Sep 9, 2022
  3. tacaswell commented on Dec 5, 2022

    @tacaswell
    Member

    Can we expand this to also include what we expect clear / clf to do at the Figure level?

  4. modified the milestones: v3.7.0, v3.8.0 on Dec 16, 2022
  5. removed this from the v3.8.0 milestone on Sep 15, 2023
  6. added this to the v3.9.0 milestone on Dec 6, 2023
  7. added 3 commits that reference this issue on Dec 6, 2023
    215f053
    b727ac3
    dd19976
  8. added 3 commits that reference this issue on Mar 8, 2024
    708d945
    c843cfd
    2990c46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …Maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions