File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import matplotlib .patches as patches
2121import matplotlib .path as path
2222
23- fig , axs = plt .subplots (2 )
24-
2523np .random .seed (19680801 ) # Fixing random state for reproducibility
2624
2725# histogram our data with numpy
4442# make a patch out of it, don't add a margin at y=0
4543patch = patches .PathPatch (barpath )
4644patch .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 ()
4950
5051# %%
5152# Instead of creating a three-dimensional array and using
7273# make a patch out of it, don't add a margin at y=0
7374patch = patches .PathPatch (barpath )
7475patch .sticky_edges .y [:] = [0 ]
75- axs [1 ].add_patch (patch )
76- axs [1 ].autoscale_view ()
7776
77+ fig , ax = plt .subplots ()
78+ ax .add_patch (patch )
79+ ax .autoscale_view ()
7880plt .show ()
7981
8082# %%
You can’t perform that action at this time.
0 commit comments