@@ -280,27 +280,15 @@ def _xy_from_xy(self, x, y):
280
280
y = y [:, np .newaxis ]
281
281
return x , y
282
282
283
- def _getdefaults (self , ignore , * kwargs ):
283
+ def _getdefaults (self , ignore , kw ):
284
284
"""
285
- Only advance the cycler if the cycler has information that
286
- is not specified in any of the supplied tuple of dicts.
287
- Ignore any keys specified in the `ignore` set.
288
-
289
- Returns a copy of defaults dictionary if there are any
290
- keys that are not found in any of the supplied dictionaries.
291
- If the supplied dictionaries have non-None values for
292
- everything the property cycler has, then just return
293
- an empty dictionary. Ignored keys are excluded from the
294
- returned dictionary.
295
-
285
+ If some keys in the property cycle (excluding those in the set
286
+ *ignore*) are absent or set to None in the dict *kw*, return a copy
287
+ of the next entry in the property cycle, excluding keys in *ignore*.
288
+ Otherwise, don't advance the property cycle, and return an empty dict.
296
289
"""
297
- prop_keys = self ._prop_keys
298
- if ignore is None :
299
- ignore = set ()
300
- prop_keys = prop_keys - ignore
301
-
302
- if any (all (kw .get (k , None ) is None for kw in kwargs )
303
- for k in prop_keys ):
290
+ prop_keys = self ._prop_keys - ignore
291
+ if any (kw .get (k , None ) is None for k in prop_keys ):
304
292
# Need to copy this dictionary or else the next time around
305
293
# in the cycle, the dictionary could be missing entries.
306
294
default_dict = next (self .prop_cycler ).copy ()
@@ -310,21 +298,18 @@ def _getdefaults(self, ignore, *kwargs):
310
298
default_dict = {}
311
299
return default_dict
312
300
313
- def _setdefaults (self , defaults , * kwargs ):
301
+ def _setdefaults (self , defaults , kw ):
314
302
"""
315
- Given a defaults dictionary, and any other dictionaries,
316
- update those other dictionaries with information in defaults if
317
- none of the other dictionaries contains that information.
318
-
303
+ Add to the dict *kw* the entries in the dict *default* that are absent
304
+ or set to None in *kw*.
319
305
"""
320
306
for k in defaults :
321
- if all (kw .get (k , None ) is None for kw in kwargs ):
322
- for kw in kwargs :
323
- kw [k ] = defaults [k ]
307
+ if kw .get (k , None ) is None :
308
+ kw [k ] = defaults [k ]
324
309
325
310
def _makeline (self , x , y , kw , kwargs ):
326
311
kw = {** kw , ** kwargs } # Don't modify the original kw.
327
- default_dict = self ._getdefaults (None , kw )
312
+ default_dict = self ._getdefaults (set () , kw )
328
313
self ._setdefaults (default_dict , kw )
329
314
seg = mlines .Line2D (x , y , ** kw )
330
315
return seg
@@ -425,8 +410,6 @@ def _plot_args(self, tup, kwargs):
425
410
426
411
427
412
class _AxesBase (martist .Artist ):
428
- """
429
- """
430
413
name = "rectilinear"
431
414
432
415
_shared_x_axes = cbook .Grouper ()
0 commit comments