Skip to content

[Bug]: polar projection with labels on set_ticks gives UserWarning #31574

@hoxbro

Description

@hoxbro

Bug summary

When testing out v3.11.0rc1 I'm starting to see a UserWarning when running the following code. I don't think this is expected behavior. Didn't get it on v3.10.

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots(subplot_kw={"projection": "polar"})
ax.yaxis.set_ticks([0.25, 0.5, 0.75, 1.0], labels=["A", "B", "C", "D"])

Actual outcome

Getting this UserWarning:

UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator. Otherwise, ticks may be mislabeled.
  ax.yaxis.set_ticks([0.25, 0.5, 0.75, 1.0], labels=["A", "B", "C", "D"])

Expected outcome

No UserWarning

Additional information

No response

Operating system

No response

Matplotlib Version

3.11.0rc1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.status: confirmed bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions