Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
[DOC] Clarify some tick-related docstrings#26619
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Um bunch of comments trying to make things more explicit while also balancing conciseness. I also think a good follow up could be an example showing what all these mean. kinda likehttps://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/axis_equal_demo.html
Uh oh!
There was an error while loading.Please reload this page.
lib/matplotlib/axes/_base.py Outdated
This affects the tick components (tick markers, tick labels, grid lines), the | ||
axis lines (spines) and the axis labels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thisaffectsthetickcomponents (tickmarkers,ticklabels,gridlines),the | |
axislines (spines)andtheaxislabels. | |
Thisremovestheaxislabels,axisspines,andtheaxistickcomponents,whicharethetickmarkers,ticklabels,andgridlines. |
removing parenthesis and I think spine is fine in context
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
'square' Square plot; similar to 'scaled', but initially forcing | ||
``xmax-xmin == ymax-ymin``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should this maybe be moved under scaled then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As above: scaling is not in the scope of the PR
Additionally, further autoscaling will be disabled. | ||
'tight' Set limits just large enough to show all data, then | ||
disable further autoscaling. | ||
'auto' Automatic scaling (fill plot box with data). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what does fill plot box (Axes?) with data mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As above: scaling is not in the scope of the PR
4bba6cc
to7296cf2
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've rewritten the docstrings forset_axis_on/off
with the focus on making it clear thatset_axis_off()
is a global switch to hide all decorations (I intentionally use "hide" and not "remove" because the latter has a notion of delete.)
@@ -2090,7 +2090,7 @@ def _set_tick_locations(self, ticks, *, minor=False): | |||
def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs): | |||
""" | |||
Set this Axis' tick locations and optionally labels. | |||
Set this Axis' tick locations and optionallyticklabels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The function is thenAxes.set_yticks
. While "y" is in the function name, it's nice to mention the axis in the docstring explicitly, because Axes has more than one axis.
Uh oh!
There was an error while loading.Please reload this page.
lib/matplotlib/axes/_base.py Outdated
'on' or `True` Do not hide all axis decorations, i.e. axis labels, spines, | ||
tick marks, tick labels, and grid lines. | ||
This is the same as `~.Axes.set_axis_on()`. | ||
'off' or `False` Hide all axis decorations, i.e. axis labels, spines, | ||
tick marks, tick labels, and grid lines. | ||
This is the same as `~.Axes.set_axis_off()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
'on'or`True`Donothideallaxisdecorations,i.e.axislabels,spines, | |
tickmarks,ticklabels,andgridlines. | |
Thisisthesameas`~.Axes.set_axis_on()`. | |
'off'or`False`Hideallaxisdecorations,i.e.axislabels,spines, | |
tickmarks,ticklabels,andgridlines. | |
Thisisthesameas`~.Axes.set_axis_off()`. | |
'off'or`False`Hideallaxisdecorations,i.e.axislabels,spines, | |
tickmarks,ticklabels,andgridlines. | |
Thisisthesameas`~.Axes.set_axis_off()`. | |
'on'or`True`Donothideaxisdecorations,i.e.axislabels,spines, | |
tickmarks,ticklabels,andgridlines. | |
Thisisthesameas`~.Axes.set_axis_on()`. | |
partly b/c off is more commonly used, partly b/c 'do not hide all' is doing something strange where it can still mean 'hide some' -which is true but not what the sentence is trying to say, so it's maybe clearer if set up as a contrast to 'off'
lib/matplotlib/axes/_base.py Outdated
This affects the axis lines, ticks, ticklabels, grid and axis labels. | ||
This is an Axes-wide setting to suppress drawing of all axis decorations, i.e. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ThisisanAxes-widesettingtosuppressdrawingofallaxisdecorations,i.e. | |
Thissettingsuppressesdrawingofallaxisdecorations,i.e. |
per convo w/@QuLogic, I don't think the termAxes-wide
adds anything so I'd rather we not create a new term.
Apply suggestions from code reviewCo-authored-by: hannah <story645@gmail.com>
…619-on-v3.8.xBackport PR#26619 on branch v3.8.x ([DOC] Clarify some tick-related docstrings)
Inspired by#26612.