Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
MNT: Prevent users from erroneously using legend label API on Axis#28584
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1421,8 +1421,21 @@ | ||
return cbook.silent_list('Line2D gridline', | ||
[tick.gridline for tick in ticks]) | ||
def set_label(self, s): | ||
"""Assigning legend labels is not supported. Raises RuntimeError.""" | ||
raise RuntimeError( | ||
"A legend label cannot be assigned to an Axis. Did you mean to " | ||
"set the axis label via set_label_text()?") | ||
def get_label(self): | ||
""" | ||
Return the axis label as a Text instance. | ||
.. admonition:: Discouraged | ||
This overrides `.Artist.get_label`, which is for legend labels, with a new | ||
semantic. It is recommended to use the attribute ``Axis.label`` instead. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Can we get There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The way attributes are currently documented - Attributes section in the class docstring (https://matplotlib.org/stable/api/axis_api.html#matplotlib.axis.Axis) - they cannot be referenced. I believe we must swich to something like#28825. But before going full scale, we should test it on | ||
""" | ||
return self.label | ||
def get_offset_text(self): | ||
Uh oh!
There was an error while loading.Please reload this page.