@@ -235,27 +235,15 @@ def _xy_from_xy(self, x, y):
235
235
y = y [:, np .newaxis ]
236
236
return x , y
237
237
238
- def _getdefaults (self , ignore , * kwargs ):
238
+ def _getdefaults (self , ignore , kw ):
239
239
"""
240
- Only advance the cycler if the cycler has information that
241
- is not specified in any of the supplied tuple of dicts.
242
- Ignore any keys specified in the `ignore` set.
243
-
244
- Returns a copy of defaults dictionary if there are any
245
- keys that are not found in any of the supplied dictionaries.
246
- If the supplied dictionaries have non-None values for
247
- everything the property cycler has, then just return
248
- an empty dictionary. Ignored keys are excluded from the
249
- returned dictionary.
250
-
240
+ If some keys in the property cycle (excluding those in the set
241
+ *ignore*) are absent or set to None in the dict *kw*, return a copy
242
+ of the next entry in the property cycle, excluding keys in *ignore*.
243
+ Otherwise, don't advance the property cycle, and return an empty dict.
251
244
"""
252
- prop_keys = self ._prop_keys
253
- if ignore is None :
254
- ignore = set ()
255
- prop_keys = prop_keys - ignore
256
-
257
- if any (all (kw .get (k , None ) is None for kw in kwargs )
258
- for k in prop_keys ):
245
+ prop_keys = self ._prop_keys - ignore
246
+ if any (kw .get (k , None ) is None for k in prop_keys ):
259
247
# Need to copy this dictionary or else the next time around
260
248
# in the cycle, the dictionary could be missing entries.
261
249
default_dict = next (self .prop_cycler ).copy ()
@@ -265,21 +253,18 @@ def _getdefaults(self, ignore, *kwargs):
265
253
default_dict = {}
266
254
return default_dict
267
255
268
- def _setdefaults (self , defaults , * kwargs ):
256
+ def _setdefaults (self , defaults , kw ):
269
257
"""
270
- Given a defaults dictionary, and any other dictionaries,
271
- update those other dictionaries with information in defaults if
272
- none of the other dictionaries contains that information.
273
-
258
+ Add to the dict *kw* the entries in the dict *default* that are absent
259
+ or set to None in *kw*.
274
260
"""
275
261
for k in defaults :
276
- if all (kw .get (k , None ) is None for kw in kwargs ):
277
- for kw in kwargs :
278
- kw [k ] = defaults [k ]
262
+ if kw .get (k , None ) is None :
263
+ kw [k ] = defaults [k ]
279
264
280
265
def _makeline (self , x , y , kw , kwargs ):
281
266
kw = {** kw , ** kwargs } # Don't modify the original kw.
282
- default_dict = self ._getdefaults (None , kw )
267
+ default_dict = self ._getdefaults (set () , kw )
283
268
self ._setdefaults (default_dict , kw )
284
269
seg = mlines .Line2D (x , y , ** kw )
285
270
return seg
@@ -391,8 +376,6 @@ def _grab_next_args(self, *args, **kwargs):
391
376
392
377
393
378
class _AxesBase (martist .Artist ):
394
- """
395
- """
396
379
name = "rectilinear"
397
380
398
381
_shared_x_axes = cbook .Grouper ()
0 commit comments