8000 [Bug]: set_ticks provides mysterious error message · Issue #26283 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: set_ticks provides mysterious error message #26283
Closed
@jklymak

Description

@jklymak

Bug summary

set_yticks(ticks, which="minor") errors with ValueError: labels argument cannot be None when kwargs are passed.

Code for reproduction

fig, ax = plt.subplots(figsize=(5.4, 5.4), layout='constrained')
x = np.arange(100)
for nn, ax in enumerate(axs):
    ax.plot(x, x)
    ax.set_yticks(np.arange(0, 100.1, 100/3))
    ax.set_yticks(np.arange(0, 100.1, 100/30), which='minor')

Actual outcome

ValueError: labels argument cannot be None when kwargs are passed

Expected outcome

Two issues here: which='minor' is incorrect for set_yticks, I should have done minor=True. It's a bit annoying that which is the kwarg for some things and minor for set_yticks.

Second, the error message is somewhat annoying as I would have expected this call to work or give me an error for an incorrect kwarg.

Additional information

No response

Operating system

No response

Matplotlib Version

main

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0