Skip to content

suggestion: set_xticklabels and set_yticklabels default to current labels #6795

@chubukov

Description

@chubukov

I often find myself writing a construction like this:

ax.set_xticklabels([x.get_text() for x in ax.get_xticklabels()],rotation=90)

This just looks ugly and it feels to me like this should have the same effect:

ax.set_xticklabels(rotation=90)

which would just require handling labels=None and defaulting to the current labels.

Or is there already a more idiomatic way to do this that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions