Skip to content

Document Axes.spines #29965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/axes_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Attributes

Axes.viewLim
Axes.dataLim
Axes.spines

Plotting
========
Expand Down
6 changes: 6 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ class _AxesBase(martist.Artist):
dataLim: mtransforms.Bbox
"""The bounding `.Bbox` enclosing all data displayed in the Axes."""

spines: mspines.Spines
"""
The `.Spines` container for the Axes' spines, i.e. the lines denoting the
data area boundaries.
Comment on lines +563 to +564
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

Suggested change
The `.Spines` container for the Axes' spines, i.e. the lines denoting the
data area boundaries.
The `.Spines` container for the Axes' spines, usually the lines that denote the x- and y-axis.

because the spines need not be on the data area boundaries (of course they need not be x or y axises either, but "usually" should be fine for that)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I slightly lean towards the present description. While not general, it's what the default is, and thus it's easier to understand. Possibly a more detailed description should go into the class docs?

Copy link
Member Author

@rcomer rcomer Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough because some of the spines do not have axis info on them. I still found it an odd construction.

"""

xaxis: maxis.XAxis
"""
The `.XAxis` instance.
Expand Down
Loading