8000 [Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label · Issue #27971 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label #27971
Closed
@dstansby

Description

@dstansby

Bug summary

I'm used to using the Axis API like ax.xaxis.set_major_formatter(...) etc., so to be consistent it would be nice if one could do ax.xaxis.set_label(...) instead of ax.set_xlabel(...). It seems like ax.xaxis.set_label(...) does not label the axis however.

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.xaxis.set_label("x-label")

Actual outcome

Screenshot 2024-03-24 at 10 02 10

Expected outcome

Screenshot 2024-03-24 at 10 02 26

Additional information

No response

Operating system

No response

Matplotlib Version

3.8.3

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

conda

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet
2C62

Development

No branches or pull requests

Issue actions

    0