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

Commit885c84e

Browse files
authored
Merge pull request#26635 from timhoffm/reduce-subplot_kw
[MNT] Do not configure axes properties via subplots(..., subplot_kw={...})
2 parents80fb37d +23d101a commit885c84e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

‎galleries/examples/shapes_and_collections/ellipse_demo.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@
2222
angle=np.random.rand()*360)
2323
foriinrange(NUM)]
2424

25-
fig,ax=plt.subplots(subplot_kw={'aspect':'equal'})
25+
fig,ax=plt.subplots()
26+
ax.set(xlim=(0,10),ylim=(0,10),aspect="equal")
27+
2628
foreinells:
2729
ax.add_artist(e)
2830
e.set_clip_box(ax.bbox)
2931
e.set_alpha(np.random.rand())
3032
e.set_facecolor(np.random.rand(3))
3133

32-
ax.set_xlim(0,10)
33-
ax.set_ylim(0,10)
34-
3534
plt.show()
3635

3736
# %%
@@ -45,15 +44,13 @@
4544
angle_step=45# degrees
4645
angles=np.arange(0,180,angle_step)
4746

48-
fig,ax=plt.subplots(subplot_kw={'aspect':'equal'})
47+
fig,ax=plt.subplots()
48+
ax.set(xlim=(-2.2,2.2),ylim=(-2.2,2.2),aspect="equal")
4949

5050
forangleinangles:
5151
ellipse=Ellipse((0,0),4,2,angle=angle,alpha=0.1)
5252
ax.add_artist(ellipse)
5353

54-
ax.set_xlim(-2.2,2.2)
55-
ax.set_ylim(-2.2,2.2)
56-
5754
plt.show()
5855

5956
# %%

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp