@@ -223,26 +223,21 @@ class _process_plot_var_args:
223
223
def __init__ (self , axes , command = 'plot' ):
224
224
self .axes = axes
225
225
self .command = command
226
- self .set_prop_cycle ()
226
+ self .set_prop_cycle (None )
227
227
228
228
def __getstate__ (self ):
229
229
# note: it is not possible to pickle a generator (and thus a cycler).
230
230
return {'axes' : self .axes , 'command' : self .command }
231
231
232
232
def __setstate__ (self , state ):
233
233
self .__dict__ = state .copy ()
234
- self .set_prop_cycle ()
234
+ self .set_prop_cycle (None )
235
235
236
- def set_prop_cycle (self , * args , ** kwargs ):
237
- # Can't do `args == (None,)` as that crashes cycler.
238
- if not (args or kwargs ) or (len (args ) == 1 and args [0 ] is None ):
239
- prop_cycler = mpl .rcParams ['axes.prop_cycle' ]
240
- else :
241
- prop_cycler = cycler (* args , ** kwargs )
242
-
243
- self .prop_cycler = itertools .cycle (prop_cycler )
244
- # This should make a copy
245
- self ._prop_keys = prop_cycler .keys
236
+ def set_prop_cycle (self , cycler ):
237
+ if cycler is None :
238
+ cycler = mpl .rcParams ['axes.prop_cycle' ]
239
+ self .prop_cycler = itertools .cycle (cycler )
240
+ self ._prop_keys = cycler .keys # This should make a copy
246
241
247
242
def __call__ (self , * args , data = None , ** kwargs ):
248
243
self .axes ._process_unit_info (kwargs = kwargs )
0 commit comments