Skip to content

Commit

Permalink
DOC: Fix calculation of bin centers in multi-histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Jul 9, 2022
1 parent 5988611 commit 33a39d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/statistics/multiple_histograms_side_by_side.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

# The bin_edges are the same for all of the histograms
bin_edges = np.linspace(hist_range[0], hist_range[1], number_of_bins + 1)
centers = 0.5 * (bin_edges + np.roll(bin_edges, 1))[:-1]
heights = np.diff(bin_edges)
centers = bin_edges[:-1] + heights / 2

# Cycle through and plot each histogram
fig, ax = plt.subplots()
Expand Down

0 comments on commit 33a39d4

Please sign in to comment.