9
9
import matplotlib .pyplot as plt
10
10
from matplotlib .patches import Rectangle
11
11
12
- fig , axs = plt .subplots (2 , 5 , constrained_layout = True , figsize = (10 , 5 ))
12
+ fig , axs = plt .subplots (2 , 5 , constrained_layout = True , figsize = (6.4 , 3.2 ))
13
13
14
14
hatches = ['/' , '\\ ' , '|' , '-' , '+' , 'x' , 'o' , 'O' , '.' , '*' ]
15
15
@@ -20,6 +20,26 @@ def hatches_plot(ax, h):
20
20
ax .axis ('equal' )
21
21
ax .axis ('off' )
22
22
23
+ for ax , h in zip (axs .flat , hatches ):
24
+ hatches_plot (ax , h )
25
+
26
+ ###############################################################################
27
+ # Hatching patterns can be repeated to increase the density.
28
+
29
+ fig , axs = plt .subplots (2 , 5 , constrained_layout = True , figsize = (6.4 , 3.2 ))
30
+
31
+ hatches = ['//' , '\\ \\ ' , '||' , '--' , '++' , 'xx' , 'oo' , 'OO' , '..' , '**' ]
32
+
33
+ for ax , h in zip (axs .flat , hatches ):
34
+ hatches_plot (ax , h )
35
+
36
+ ###############################################################################
37
+ # Hatching patterns can be combined to create additional patterns.
38
+
39
+ fig , axs = plt .subplots (2 , 5 , constrained_layout = True , figsize = (6.4 , 3.2 ))
40
+
41
+ hatches = ['/o' , '\\ |' , '|*' , '-\\ ' , '+o' , 'x*' , 'o-' , 'O|' , 'O.' , '*-' ]
42
+
23
43
for ax , h in zip (axs .flat , hatches ):
24
44
hatches_plot (ax , h )
25
45
0 commit comments