Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 33a39d4

Browse filesBrowse files
committed
DOC: Fix calculation of bin centers in multi-histogram
As noted in https://discourse.matplotlib.org/t/tiny-error-in-matplotlib-gallery/22978
1 parent 5988611 commit 33a39d4
Copy full SHA for 33a39d4

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎examples/statistics/multiple_histograms_side_by_side.py

Copy file name to clipboardExpand all lines: examples/statistics/multiple_histograms_side_by_side.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.