Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions galleries/examples/misc/histogram_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()

# %%
Expand Down