@@ -6103,6 +6103,10 @@ def hist(self, x, bins=None, range=None, normed=False, weights=None,
6103
6103
.. plot:: mpl_examples/statistics/histogram_demo_features.py
6104
6104
6105
6105
"""
6106
+ # Avoid shadowing the builtin.
6107
+ bin_range = range
6108
+ del range
6109
+
6106
6110
def _normalize_input (inp , ename = 'input' ):
6107
6111
"""Normalize 1 or 2d input into list of np.ndarray or
6108
6112
a single 2D np.ndarray.
@@ -6147,13 +6151,6 @@ def _normalize_input(inp, ename='input'):
6147
6151
if bins is None :
6148
6152
bins = rcParams ['hist.bins' ]
6149
6153
6150
- # xrange becomes range after 2to3
6151
- bin_range = range
6152
- range = __builtins__ ["range" ]
6153
-
6154
- # NOTE: the range keyword overwrites the built-in func range !!!
6155
- # needs to be fixed in numpy !!!
6156
-
6157
6154
# Validate string inputs here so we don't have to clutter
6158
6155
# subsequent code.
6159
6156
if histtype not in ['bar' , 'barstacked' , 'step' , 'stepfilled' ]:
@@ -6514,10 +6511,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
6514
6511
.. plot:: mpl_examples/statistics/plot_hist.py
6515
6512
"""
6516
6513
6517
- # xrange becomes range after 2to3
6518
- bin_range = range
6519
- range = __builtins__ ["range" ]
6520
- h , xedges , yedges = np .histogram2d (x , y , bins = bins , range = bin_range ,
6514
+ h , xedges , yedges = np .histogram2d (x , y , bins = bins , range = range ,
6521
6515
normed = normed , weights = weights )
6522
6516
6523
6517
if cmin is not None :
0 commit comments