99import matplotlib .pyplot as plt
1010from matplotlib .patches import Rectangle
1111
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 ))
1313
1414hatches = ['/' , '\\ ' , '|' , '-' , '+' , 'x' , 'o' , 'O' , '.' , '*' ]
1515
@@ -20,6 +20,26 @@ def hatches_plot(ax, h):
2020 ax .axis ('equal' )
2121 ax .axis ('off' )
2222
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+
2343for ax , h in zip (axs .flat , hatches ):
2444 hatches_plot (ax , h )
2545
0 commit comments