SpanSelector widget: Improve doc for extents#27397
Conversation
Co-authored-by: hannah <[email protected]>
|
sorry my suggestion made the line too long so you'll have to fix that |
lib/matplotlib/widgets.py
Outdated
| @property | ||
| def direction(self): | ||
| """Direction of the span selector: 'vertical' or 'horizontal'.""" | ||
| """Direction of the span selector: 'vertical' or 'horizontal'. Writable.""" |
There was a problem hiding this comment.
What are you trying to communicate w/ writable?
There was a problem hiding this comment.
The property has a setter. When everything else in matplotlib is set_title() or whatever, I don't take that for granted.
There was a problem hiding this comment.
No guidance here for if properties were actually used. https://matplotlib.org/devdocs/devel/document.html#setters-and-getters
There was a problem hiding this comment.
@judfs can you remove the writable? I don't think it's conveying what you intend to here and I don't want to hold up your PR longer
There was a problem hiding this comment.
Changed 👍 . As a user of mpl, I still would find it non obvious that the property is read/write / settable, but that is a more general issue. For now glad to have what the extents are described.
|
Thanks for the contribution! I think there's follow up here, both on how we communicate that something is a property and probably similar to #27200 about adding an extents role to the one place we define extents. |
…397-on-v3.8.x Backport PR #27397 on branch v3.8.x (SpanSelector widget: Improve doc for `extents`)
PR summary
Explains what the extents are. Addresses my problem here https://discourse.matplotlib.org/t/spanselector-how-to-set-selection-with-code/24114/4
Old:
https://matplotlib.org/stable/api/widgets_api.html#matplotlib.widgets.SpanSelector.extents
New rendering:
PR checklist