3333import matplotlib .ticker as mticker
3434import matplotlib .transforms as mtransforms
3535import matplotlib .tri as mtri
36- from matplotlib .cbook import iterable
3736from matplotlib .container import BarContainer , ErrorbarContainer , StemContainer
3837from matplotlib .axes ._base import _AxesBase , _process_plot_format
3938
@@ -1035,11 +1034,11 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
10351034 xmin = self .convert_xunits (xmin )
10361035 xmax = self .convert_xunits (xmax )
10371036
1038- if not iterable (y ):
1037+ if not np . iterable (y ):
10391038 y = [y ]
1040- if not iterable (xmin ):
1039+ if not np . iterable (xmin ):
10411040 xmin = [xmin ]
1042- if not iterable (xmax ):
1041+ if not np . iterable (xmax ):
10431042 xmax = [xmax ]
10441043
10451044 y , xmin , xmax = cbook .delete_masked_points (y , xmin , xmax )
@@ -1113,11 +1112,11 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
11131112 ymin = self .convert_yunits (ymin )
11141113 ymax = self .convert_yunits (ymax )
11151114
1116- if not iterable (x ):
1115+ if not np . iterable (x ):
11171116 x = [x ]
1118- if not iterable (ymin ):
1117+ if not np . iterable (ymin ):
11191118 ymin = [ymin ]
1120- if not iterable (ymax ):
1119+ if not np . iterable (ymax ):
11211120 ymax = [ymax ]
11221121
11231122 x , ymin , ymax = cbook .delete_masked_points (x , ymin , ymax )
@@ -1243,9 +1242,9 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
12431242 lineoffsets = self .convert_yunits (lineoffsets )
12441243 linelengths = self .convert_yunits (linelengths )
12451244
1246- if not iterable (positions ):
1245+ if not np . iterable (positions ):
12471246 positions = [positions ]
1248- elif any (iterable (position ) for position in positions ):
1247+ elif any (np . iterable (position ) for position in positions ):
12491248 positions = [np .asanyarray (position ) for position in positions ]
12501249 else :
12511250 positions = [np .asanyarray (positions )]
@@ -1259,15 +1258,15 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
12591258 linewidths = cbook .local_over_kwdict (linewidths , kwargs , 'linewidth' )
12601259 linestyles = cbook .local_over_kwdict (linestyles , kwargs , 'linestyle' )
12611260
1262- if not iterable (lineoffsets ):
1261+ if not np . iterable (lineoffsets ):
12631262 lineoffsets = [lineoffsets ]
1264- if not iterable (linelengths ):
1263+ if not np . iterable (linelengths ):
12651264 linelengths = [linelengths ]
1266- if not iterable (linewidths ):
1265+ if not np . iterable (linewidths ):
12671266 linewidths = [linewidths ]
1268- if not iterable (colors ):
1267+ if not np . iterable (colors ):
12691268 colors = [colors ]
1270- if hasattr (linestyles , 'lower' ) or not iterable (linestyles ):
1269+ if hasattr (linestyles , 'lower' ) or not np . iterable (linestyles ):
12711270 linestyles = [linestyles ]
12721271
12731272 lineoffsets = np .asarray (lineoffsets )
@@ -3065,18 +3064,18 @@ def errorbar(self, x, y, yerr=None, xerr=None,
30653064 ecolor = base_style ['color' ]
30663065 # make sure all the args are iterable; use lists not arrays to
30673066 # preserve units
3068- if not iterable (x ):
3067+ if not np . iterable (x ):
30693068 x = [x ]
30703069
3071- if not iterable (y ):
3070+ if not np . iterable (y ):
30723071 y = [y ]
30733072
30743073 if xerr is not None :
3075- if not iterable (xerr ):
3074+ if not np . iterable (xerr ):
30763075 xerr = [xerr ] * len (x )
30773076
30783077 if yerr is not None :
3079- if not iterable (yerr ):
3078+ if not np . iterable (yerr ):
30803079 yerr = [yerr ] * len (y )
30813080
30823081 # make the style dict for the 'normal' plot line
@@ -3168,7 +3167,7 @@ def extract_err(err, data):
31683167 except (TypeError , ValueError ):
31693168 pass
31703169 else :
3171- if iterable (a ) and iterable (b ):
3170+ if np . iterable (a ) and np . iterable (b ):
31723171 # using list comps rather than arrays to preserve units
31733172 low = [thisx - thiserr for thisx , thiserr
31743173 in cbook .safezip (data , a )]
@@ -4437,7 +4436,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
44374436 x , y , C = cbook .delete_masked_points (x , y , C )
44384437
44394438 # Set the size of the hexagon grid
4440- if iterable (gridsize ):
4439+ if np . iterable (gridsize ):
44414440 nx , ny = gridsize
44424441 else :
44434442 nx = gridsize
@@ -4632,7 +4631,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
46324631 norm .autoscale (accum )
46334632
46344633 if bins is not None :
4635- if not iterable (bins ):
4634+ if not np . iterable (bins ):
46364635 minimum , maximum = min (accum ), max (accum )
46374636 bins -= 1 # one less edge than bins
46384637 bins = minimum + (maximum - minimum ) * np .arange (bins ) / bins
@@ -6514,7 +6513,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
65146513 bin_range = self .convert_xunits (bin_range )
65156514
65166515 # 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
65186517
65196518 # We need to do to 'weights' what was done to 'x'
65206519 if weights is not None :
0 commit comments