33
33
import matplotlib .ticker as mticker
34
34
import matplotlib .transforms as mtransforms
35
35
import matplotlib .tri as mtri
36
- from matplotlib .cbook import iterable
37
36
from matplotlib .container import BarContainer , ErrorbarContainer , StemContainer
38
37
from matplotlib .axes ._base import _AxesBase , _process_plot_format
39
38
@@ -1035,11 +1034,11 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
1035
1034
xmin = self .convert_xunits (xmin )
1036
1035
xmax = self .convert_xunits (xmax )
1037
1036
1038
- if not iterable (y ):
1037
+ if not np . iterable (y ):
1039
1038
y = [y ]
1040
- if not iterable (xmin ):
1039
+ if not np . iterable (xmin ):
1041
1040
xmin = [xmin ]
1042
- if not iterable (xmax ):
1041
+ if not np . iterable (xmax ):
1043
1042
xmax = [xmax ]
1044
1043
1045
1044
y , xmin , xmax = cbook .delete_masked_points (y , xmin , xmax )
@@ -1113,11 +1112,11 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
1113
1112
ymin = self .convert_yunits (ymin )
1114
1113
ymax = self .convert_yunits (ymax )
1115
1114
1116
- if not iterable (x ):
1115
+ if not np . iterable (x ):
1117
1116
x = [x ]
1118
- if not iterable (ymin ):
1117
+ if not np . iterable (ymin ):
1119
1118
ymin = [ymin ]
1120
- if not iterable (ymax ):
1119
+ if not np . iterable (ymax ):
1121
1120
ymax = [ymax ]
1122
1121
1123
1122
x , ymin , ymax = cbook .delete_masked_points (x , ymin , ymax )
@@ -1243,9 +1242,9 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1243
1242
lineoffsets = self .convert_yunits (lineoffsets )
1244
1243
linelengths = self .convert_yunits (linelengths )
1245
1244
1246
- if not iterable (positions ):
1245
+ if not np . iterable (positions ):
1247
1246
positions = [positions ]
1248
- elif any (iterable (position ) for position in positions ):
1247
+ elif any (np . iterable (position ) for position in positions ):
1249
1248
positions = [np .asanyarray (position ) for position in positions ]
1250
1249
else :
1251
1250
positions = [np .asanyarray (positions )]
@@ -1259,15 +1258,15 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1259
1258
linewidths = cbook .local_over_kwdict (linewidths , kwargs , 'linewidth' )
1260
1259
linestyles = cbook .local_over_kwdict (linestyles , kwargs , 'linestyle' )
1261
1260
1262
- if not iterable (lineoffsets ):
1261
+ if not np . iterable (lineoffsets ):
1263
1262
lineoffsets = [lineoffsets ]
1264
- if not iterable (linelengths ):
1263
+ if not np . iterable (linelengths ):
1265
1264
linelengths = [linelengths ]
1266
- if not iterable (linewidths ):
1265
+ if not np . iterable (linewidths ):
1267
1266
linewidths = [linewidths ]
1268
- if not iterable (colors ):
1267
+ if not np . iterable (colors ):
1269
1268
colors = [colors ]
1270
- if hasattr (linestyles , 'lower' ) or not iterable (linestyles ):
1269
+ if hasattr (linestyles , 'lower' ) or not np . iterable (linestyles ):
1271
1270
linestyles = [linestyles ]
1272
1271
1273
1272
lineoffsets = np .asarray (lineoffsets )
@@ -3065,18 +3064,18 @@ def errorbar(self, x, y, yerr=None, xerr=None,
3065
3064
ecolor = base_style ['color' ]
3066
3065
# make sure all the args are iterable; use lists not arrays to
3067
3066
# preserve units
3068
- if not iterable (x ):
3067
+ if not np . iterable (x ):
3069
3068
x = [x ]
3070
3069
3071
- if not iterable (y ):
3070
+ if not np . iterable (y ):
3072
3071
y = [y ]
3073
3072
3074
3073
if xerr is not None :
3075
- if not iterable (xerr ):
3074
+ if not np . iterable (xerr ):
3076
3075
xerr = [xerr ] * len (x )
3077
3076
3078
3077
if yerr is not None :
3079
- if not iterable (yerr ):
3078
+ if not np . iterable (yerr ):
3080
3079
yerr = [yerr ] * len (y )
3081
3080
3082
3081
# make the style dict for the 'normal' plot line
@@ -3168,7 +3167,7 @@ def extract_err(err, data):
3168
3167
except (TypeError , ValueError ):
3169
3168
pass
3170
3169
else :
3171
- if iterable (a ) and iterable (b ):
3170
+ if np . iterable (a ) and np . iterable (b ):
3172
3171
# using list comps rather than arrays to preserve units
3173
3172
low = [thisx - thiserr for thisx , thiserr
3174
3173
in cbook .safezip (data , a )]
@@ -4437,7 +4436,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
4437
4436
x , y , C = cbook .delete_masked_points (x , y , C )
4438
4437
4439
4438
# Set the size of the hexagon grid
4440
- if iterable (gridsize ):
4439
+ if np . iterable (gridsize ):
4441
4440
nx , ny = gridsize
4442
4441
else :
4443
4442
nx = gridsize
@@ -4632,7 +4631,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
4632
4631
norm .autoscale (accum )
4633
4632
4634
4633
if bins is not None :
4635
- if not iterable (bins ):
4634
+ if not np . iterable (bins ):
4636
4635
minimum , maximum = min (accum ), max (accum )
4637
4636
bins -= 1 # one less edge than bins
4638
4637
bins = minimum + (maximum - minimum ) * np .arange (bins ) / bins
@@ -6514,7 +6513,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6514
6513
bin_range = self .convert_xunits (bin_range )
6515
6514
6516
6515
# Check whether bins or range are given explicitly.
6517
- binsgiven = ( cbook .iterable (bins ) or bin_range is not None )
6516
+ binsgiven = np .iterable (bins ) or bin_range is not None
6518
6517
6519
6518
# We need to do to 'weights' what was done to 'x'
6520
6519
if weights is not None :
0 commit comments