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

Backport PR #30029 on branch v3.10.x (Update diagram in subplots_adjust documentation to clarify parameters)#30033

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
Changes from1 commit
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
NextNext commit
Backport PR#30029: Update diagram in subplots_adjust documentation t…
…o clarify parameters
  • Loading branch information
@timhoffm@meeseeksmachine
timhoffm authored andmeeseeksmachine committedMay 9, 2025
commitceb901ccf2044c4b3fa92b67b7a21d0c0156a19c
38 changes: 22 additions & 16 deletionsdoc/_embedded_plots/figure_subplots_adjust.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
import matplotlib.pyplot as plt


def arrow(p1, p2, **props):
axs[0, 0].annotate(
"", p1, p2, xycoords='figure fraction',
arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0, **props))


fig, axs = plt.subplots(2, 2, figsize=(6.5, 4))
fig.set_facecolor('lightblue')
fig.subplots_adjust(0.1, 0.1, 0.9, 0.9, 0.4, 0.4)

overlay = fig.add_axes([0, 0, 1, 1], zorder=100)
overlay.axis("off")
xycoords='figure fraction'

Check failure on line 10 in doc/_embedded_plots/figure_subplots_adjust.py

View workflow job for this annotation

GitHub Actions/ flake8

[flake8] reported by reviewdog 🐶E225 missing whitespace around operatorRaw Output:./doc/_embedded_plots/figure_subplots_adjust.py:10:9: E225 missing whitespace around operator
arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0)

Check failure on line 11 in doc/_embedded_plots/figure_subplots_adjust.py

View workflow job for this annotation

GitHub Actions/ flake8

[flake8] reported by reviewdog 🐶E225 missing whitespace around operatorRaw Output:./doc/_embedded_plots/figure_subplots_adjust.py:11:11: E225 missing whitespace around operator

for ax in axs.flat:
ax.set(xticks=[], yticks=[])

arrow((0, 0.75), (0.1, 0.75)) # left
arrow((0.435, 0.75), (0.565, 0.75)) # wspace
arrow((0.9, 0.75), (1, 0.75)) # right
overlay.annotate("", (0, 0.75), (0.1, 0.75),
xycoords=xycoords, arrowprops=arrowprops) # left
overlay.annotate("", (0.435, 0.25), (0.565, 0.25),
xycoords=xycoords, arrowprops=arrowprops) # wspace
overlay.annotate("", (0, 0.8), (0.9, 0.8),
xycoords=xycoords, arrowprops=arrowprops) # right
fig.text(0.05, 0.7, "left", ha="center")
fig.text(0.5, 0.7, "wspace", ha="center")
fig.text(0.95, 0.7, "right", ha="center")
fig.text(0.5, 0.3, "wspace", ha="center")
fig.text(0.05, 0.83, "right", ha="center")

arrow((0.25, 0), (0.25, 0.1)) # bottom
arrow((0.25, 0.435), (0.25, 0.565)) # hspace
arrow((0.25, 0.9), (0.25, 1)) # top
fig.text(0.28, 0.05, "bottom", va="center")
overlay.annotate("", (0.75, 0), (0.75, 0.1),
xycoords=xycoords, arrowprops=arrowprops) # bottom
overlay.annotate("", (0.25, 0.435), (0.25, 0.565),
xycoords=xycoords, arrowprops=arrowprops) # hspace
overlay.annotate("", (0.8, 0), (0.8, 0.9),
xycoords=xycoords, arrowprops=arrowprops) # top
fig.text(0.65, 0.05, "bottom", va="center")
fig.text(0.28, 0.5, "hspace", va="center")
fig.text(0.28, 0.95, "top", va="center")
fig.text(0.82, 0.05, "top", va="center")
Loading

[8]ページ先頭

©2009-2025 Movatter.jp