-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Document change of label visibility on shared axes #10981
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,6 +403,16 @@ keyword. | |
ax.xaxis.set_tick_params(which='both', rotation=90) | ||
|
||
|
||
Ticklabels are turned off instead of being invisible | ||
---------------------------------------------------- | ||
|
||
Internally, :func:`~matplotlib.axis.Axis.set_tick_params` is now used to | ||
hide tick labels instead of setting the visibility on the tick label objects. | ||
This improves overall performance and fixes some issues. | ||
As a consequence, in case those labels ought to be shown, `set_tick_params` | ||
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. Here also, 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. In the PR that changed that, they use Axis.set_tick_params 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. I know, but saying "use I think the problem is actually starting with the first line; the use of Axis.set_tick_params is irrelevant, and the point is not that tick labels are being hidden in a different way when subplots are shared, but that instead of being flagged as invisible, they are simply not drawn at all. The user can turn label drawing on or off via, e.g., |
||
needs to be used, e.g. `ax.xaxis.set_tick_params(labelbottom=True)`. | ||
|
||
|
||
Shading in 3D bar plots | ||
----------------------- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1265,21 +1265,21 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False, | |
- 'col': each subplot column will share an x- or y-axis. | ||
|
||
When subplots have a shared x-axis along a column, only the x tick | ||
labels of the bottom subplot are visible. Similarly, when | ||
subplots have a shared y-axis along a row, only the y tick labels | ||
of the first column subplot are visible. | ||
labels of the bottom subplot are created. Similarly, when subplots | ||
have a shared y-axis along a row, only the y tick labels of the | ||
first column subplot are created. To later turn other subplots' | ||
ticklabels on, use :meth:`~matplotlib.axis.Axis.set_tick_params`. | ||
|
||
squeeze : bool, default: True | ||
- If True, extra dimensions are squeezed out from the returned | ||
axis object: | ||
squeeze : bool, optional, default: True | ||
- If True, extra dimensions are squeezed out from the returned Axes | ||
object: | ||
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. Actually, dimensions are squeezed out of the ndarray of Axes objects, not out of any such object. |
||
|
||
- if only one subplot is constructed (nrows=ncols=1), the | ||
resulting single Axes object is returned as a scalar. | ||
- for Nx1 or 1xN subplots, the returned object is a 1D numpy | ||
object array of Axes objects are returned as numpy 1D | ||
arrays. | ||
- for NxM, subplots with N>1 and M>1 are returned as a 2D | ||
arrays. | ||
- for Nx1 or 1xM subplots, the returned object is a 1D numpy | ||
object array of Axes objects. | ||
- for NxM, subplots with N>1 and M>1 are returned | ||
as a 2D array. | ||
|
||
- If False, no squeezing at all is done: the returned Axes object | ||
is always a 2D array containing Axes instances, even if it ends | ||
|
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.
Here and in similar cases below: Is it worth adding the shorter alternative,
ax.tick_params(labelbottom=True)
? Or giving that instead of the lower-level one? That would be my preference. I think it is easier for users to work with the single point of entry for manipulating tick-related things.