Skip to content

[Bug]: Axes.clear does not reset axislabel or ticklabel sizes #21239

Open
@anntzer

Description

@anntzer

Bug summary

After clear()ing an Axes, custom axislabel or ticklabel sizes persist.

Code for reproduction

from pylab import *
ax = gca(); ax.set_xlabel("foo", size=16); ax.tick_params(labelsize=16); ax.clear(); ax.set_xlabel("foo")

Actual outcome

test

Expected outcome

The axislabel and ticklabels revert to the default size. (I think that's a saner behavior? Otherwise we should properly document what clear() resets and what it doesn't.)

Operating system

archlinux

Matplotlib Version

3.5.0.dev2168+g3b7b3a5a6f

Matplotlib Backend

any

Python version

39

Jupyter version

No response

Other libraries

No response

Installation

No response

Conda channel

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