Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Don't hide shared "x/y"ticklabels for grids of non-rectilinear axes.#19994

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

Merged
QuLogic merged 1 commit intomatplotlib:masterfromanntzer:kxytlp
May 6, 2021
Merged
Show file tree
Hide file tree
Changes fromall 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
13 changes: 7 additions & 6 deletionslib/matplotlib/gridspec.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -308,12 +308,13 @@ def subplots(self, *, sharex=False, sharey=False, squeeze=True,
self[row, col], **subplot_kw)

# turn off redundant tick labeling
if sharex in ["col", "all"]:
for ax in axarr.flat:
ax._label_outer_xaxis()
if sharey in ["row", "all"]:
for ax in axarr.flat:
ax._label_outer_yaxis()
if all(ax.name == "rectilinear" for ax in axarr.flat):
if sharex in ["col", "all"]:
for ax in axarr.flat:
ax._label_outer_xaxis()
if sharey in ["row", "all"]:
for ax in axarr.flat:
ax._label_outer_yaxis()

if squeeze:
# Discarding unneeded dimensions that equal 1. If we only have one
Expand Down
7 changes: 7 additions & 0 deletionslib/matplotlib/tests/test_polar.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -394,3 +394,10 @@ def test_remove_shared_polar(fig_ref, fig_test):
2, 2, sharey=True, subplot_kw={"projection": "polar"})
for i in [0, 1, 3]:
axs.flat[i].remove()


def test_shared_polar_keeps_ticklabels():
_, axs = plt.subplots(
2, 2, subplot_kw=dict(projection="polar"), sharex=True, sharey=True)
assert axs[0, 1].xaxis._major_tick_kw["label1On"]
assert axs[0, 1].yaxis._major_tick_kw["label1On"]

[8]ページ先頭

©2009-2025 Movatter.jp