File tree 1 file changed +8
-6
lines changed 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 20
20
import matplotlib .patches as patches
21
21
import matplotlib .path as path
22
22
23
- fig , axs = plt .subplots (2 )
24
-
25
23
np .random .seed (19680801 ) # Fixing random state for reproducibility
26
24
27
25
# histogram our data with numpy
44
42
# make a patch out of it, don't add a margin at y=0
45
43
patch = patches .PathPatch (barpath )
46
44
patch .sticky_edges .y [:] = [0 ]
47
- axs [0 ].add_patch (patch )
48
- axs [0 ].autoscale_view ()
45
+
46
+ fig , ax = plt .subplots ()
47
+ ax .add_patch (patch )
48
+ ax .autoscale_view ()
49
+ plt .show ()
49
50
50
51
# %%
51
52
# Instead of creating a three-dimensional array and using
72
73
# make a patch out of it, don't add a margin at y=0
73
74
patch = patches .PathPatch (barpath )
74
75
patch .sticky_edges .y [:] = [0 ]
75
- axs [1 ].add_patch (patch )
76
- axs [1 ].autoscale_view ()
77
76
77
+ fig , ax = plt .subplots ()
78
+ ax .add_patch (patch )
79
+ ax .autoscale_view ()
78
80
plt .show ()
79
81
80
82
# %%
You can’t perform that action at this time.
0 commit comments