Skip to content

[ENH]: Axes.set_xticks/Axis.set_ticks only validates kwargs if ticklabels are set, but they should #24273

Closed
@anntzer

Description

@anntzer

Problem

Per the doc of Axis.set_ticks:

        **kwargs
            `.Text` properties for the labels. These take effect only if you
            pass *labels*. In other cases, please use `~.Axes.tick_params`.

This means that in e.g. ax.set_xticks([0, 1], xticklabels=["a", "b"]), the incorrect xticklabels silently do nothing; they are not even validated (because labels has not been passed).

Proposed solution

We should at least check that kwargs are valid Text properties in all cases; we could even consider making any kwargs an error if labels is not set.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions