8000 FIX: cleanup · matplotlib/matplotlib@8679eaf · GitHub
[go: up one dir, main page]

Skip to content

Commit 8679eaf

Browse files
committed
FIX: cleanup
1 parent 5abb978 commit 8679eaf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/showcase/anatomy.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import numpy as np
1111
import matplotlib.pyplot as plt
12-
from matplotlib.patches import Circle
12+
from matplotlib.patches import Circle, Rectangle
1313
from matplotlib.patheffects import withStroke
1414
from matplotlib.ticker import AutoMinorLocator, MultipleLocator
1515

@@ -26,7 +26,8 @@
2626
Y3 = np.random.uniform(Y1, Y2, len(X))
2727

2828
fig = plt.figure(figsize=(8, 8), facecolor='1')
29-
ax = fig.add_subplot(1, 1, 1, aspect=1, facecolor='1')
29+
marg = 0.13
30+
ax = fig.add_axes([marg, marg, 1-1.8*marg, 1-1.8*marg], aspect=1, facecolor='1')
3031

3132

3233
def minor_tick(x, pos):
@@ -127,8 +128,8 @@ def text(x, y, text):
127128
text(0.5, 0.3, "Axes")
128129

129130
# Figure
130-
circle(3.5, 4.4)
131-
text(3.5, 4.2, "Figure")
131+
circle(4.185, 4.3)
132+
text(4.185, 4.1, "Figure")
132133

133134
# Axis
134135
circle(0.65, 0.01)
@@ -142,6 +143,8 @@ def text(x, y, text):
142143
circle(4.0, 0.7)
143144
text(4.0, 0.7-0.2, "Spine")
144145

146+
fig.add_artist(Rectangle((0, 0), width=1, height=1, facecolor='none', edgecolor='0.5', linewidth=10))
147+
145148
plt.show()
146149

147150

0 commit comments

Comments
 (0)
0