Skip to content

Commit 56c353f

Browse files
committed
FIX: if not going through hist merge logic don't discard bin_range
1 parent 9afa10f commit 56c353f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/axes/_axes.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -6656,6 +6656,8 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
66566656
"sets and %d colors were provided" % (nx, len(color)))
66576657
raise ValueError(error_message)
66586658

6659+
hist_kwargs = dict()
6660+
66596661
# If bins are not specified either explicitly or via range,
66606662
# we need to figure out the range required for all datasets,
66616663
# and supply that to np.histogram.
@@ -6666,12 +6668,12 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
66666668
_w = None
66676669
bins = histogram_bin_edges(np.concatenate(x),
66686670
bins, bin_range, _w)
6671+
else:
6672+
hist_kwargs['range'] = bin_range
66696673

66706674
density = bool(density) or bool(normed)
66716675
if density and not stacked:
66726676
hist_kwargs = dict(density=density)
6673-
else:
6674-
hist_kwargs = dict()
66756677

66766678
# List to store all the top coordinates of the histograms
66776679
tops = []

0 commit comments

Comments
 (0)