Skip to content

[Bug]: axes.get_tick_params() does not return labelbottom or labeltop #28772

Closed as not planned
GenieTim/matplotlib
#1
@GenieTim

Description

@GenieTim

Bug summary

axes.get_tick_params() introduced in #23692 returns labelright and labelleft even for the x-axis, even though the keys should be called labelbottom or labeltop. This is confusing.

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.tick_params(labelbottom=True, labeltop=True, labelright=True, labelleft=True)

tick_params = ax.get_xaxis().get_tick_params()

Actual outcome

tick_params = {
"labelright": True,
"labelleft": True,
# ..., no `labelbottom` or `labeltop`
}

Expected outcome

tick_params = {
"labelbottom": True,
"labeltop": True,
}

Additional information

The code path to this bug seems relatively clear, see here. Not sure though how to solve.

Operating system

Windows, MacOS

Matplotlib Version

3.9.1

Matplotlib Backend

No response

Python version

3.12.5

Jupyter version

No response

Installation

pip

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