9
9
10
10
import numpy as np
11
11
import matplotlib .pyplot as plt
12
- from matplotlib .patches import Circle
12
+ from matplotlib .patches import Circle , Rectangle
13
13
from matplotlib .patheffects import withStroke
14
14
from matplotlib .ticker import AutoMinorLocator , MultipleLocator
15
15
26
26
Y3 = np .random .uniform (Y1 , Y2 , len (X ))
27
27
28
28
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' )
30
31
31
32
32
33
def minor_tick (x , pos ):
@@ -127,8 +128,8 @@ def text(x, y, text):
127
128
text (0.5 , 0.3 , "Axes" )
128
129
129
130
# 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" )
132
133
133
134
# Axis
134
135
circle (0.65 , 0.01 )
@@ -142,6 +143,8 @@ def text(x, y, text):
142
143
circle (4.0 , 0.7 )
143
144
text (4.0 , 0.7 - 0.2 , "Spine" )
144
145
146
+ fig .add_artist (Rectangle ((0 , 0 ), width = 1 , height = 1 , facecolor = 'none' , edgecolor = '0.5' , linewidth = 10 ))
147
+
145
148
plt .show ()
146
149
147
150
0 commit comments