Skip to content

Commit 885c84e

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

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

galleries/examples/shapes_and_collections/ellipse_demo.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@
2222
angle=np.random.rand() * 360)
2323
for i in range(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
for e in ells:
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
for angle in angles:
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)