@@ -311,7 +311,7 @@ def get_next_color(self):
311
311
else :
312
312
return "k"
313
313
314
- def _getdefaults (self , ignore , kw ):
314
+ def _getdefaults (self , kw , ignore = frozenset () ):
315
315
"""
316
316
If some keys in the property cycle (excluding those in the set
317
317
*ignore*) are absent or set to None in the dict *kw*, return a copy
@@ -337,8 +337,7 @@ def _setdefaults(self, defaults, kw):
337
337
338
338
def _makeline (self , axes , x , y , kw , kwargs ):
339
339
kw = {** kw , ** kwargs } # Don't modify the original kw.
340
- default_dict = self ._getdefaults (set (), kw )
341
- self ._setdefaults (default_dict , kw )
340
+ self ._setdefaults (self ._getdefaults (kw ), kw )
342
341
seg = mlines .Line2D (x , y , ** kw )
343
342
return seg , kw
344
343
@@ -358,18 +357,16 @@ def _makefill(self, axes, x, y, kw, kwargs):
358
357
# *user* explicitly specifies a marker which should be an error.
359
358
# We also want to prevent advancing the cycler if there are no
360
359
# defaults needed after ignoring the given properties.
361
- ignores = {'marker' , 'markersize' , 'markeredgecolor' ,
362
- 'markerfacecolor' , 'markeredgewidth' }
363
- # Also ignore anything provided by *kwargs*.
364
- for k , v in kwargs .items ():
365
- if v is not None :
366
- ignores .add (k )
360
+ ignores = ({'marker' , 'markersize' , 'markeredgecolor' ,
361
+ 'markerfacecolor' , 'markeredgewidth' }
362
+ # Also ignore anything provided by *kwargs*.
363
+ | {k for k , v in kwargs .items () if v is not None })
367
364
368
365
# Only using the first dictionary to use as basis
369
366
# for getting defaults for back-compat reasons.
370
367
# Doing it with both seems to mess things up in
371
368
# various places (probably due to logic bugs elsewhere).
372
- default_dict = self ._getdefaults (ignores , kw )
369
+ default_dict = self ._getdefaults (kw , ignores )
373
370
self ._setdefaults (default_dict , kw )
374
371
375
372
# Looks like we don't want "color" to be interpreted to
0 commit comments