diff --git a/galleries/examples/misc/histogram_path.py b/galleries/examples/misc/histogram_path.py index 55260f9699bb..d35e291aa8ce 100644 --- a/galleries/examples/misc/histogram_path.py +++ b/galleries/examples/misc/histogram_path.py @@ -20,8 +20,6 @@ import matplotlib.patches as patches import matplotlib.path as path -fig, axs = plt.subplots(2) - np.random.seed(19680801) # Fixing random state for reproducibility # histogram our data with numpy @@ -44,8 +42,11 @@ # make a patch out of it, don't add a margin at y=0 patch = patches.PathPatch(barpath) patch.sticky_edges.y[:] = [0] -axs[0].add_patch(patch) -axs[0].autoscale_view() + +fig, ax = plt.subplots() +ax.add_patch(patch) +ax.autoscale_view() +plt.show() # %% # Instead of creating a three-dimensional array and using @@ -72,9 +73,10 @@ # make a patch out of it, don't add a margin at y=0 patch = patches.PathPatch(barpath) patch.sticky_edges.y[:] = [0] -axs[1].add_patch(patch) -axs[1].autoscale_view() +fig, ax = plt.subplots() +ax.add_patch(patch) +ax.autoscale_view() plt.show() # %%