@@ -310,7 +310,7 @@ def _makeline(self, x, y, kw, kwargs):
310
310
default_dict = self ._getdefaults (set (), kw )
311
311
self ._setdefaults (default_dict , kw )
312
312
seg = mlines .Line2D (x , y , ** kw )
313
- return seg
313
+ return seg , kw
314
314
315
315
def _makefill (self , x , y , kw , kwargs ):
316
316
# Polygon doesn't directly support unitized inputs.
@@ -362,9 +362,9 @@ def _makefill(self, x, y, kw, kwargs):
362
362
fill = kwargs .get ('fill' , True ),
363
363
closed = kw ['closed' ])
364
364
seg .set (** kwargs )
365
- return seg
365
+ return seg , kwargs
366
366
367
- def _plot_args (self , tup , kwargs ):
367
+ def _plot_args (self , tup , kwargs , return_kwargs = False ):
368
368
if len (tup ) > 1 and isinstance (tup [- 1 ], str ):
369
369
linestyle , marker , color = _process_plot_format (tup [- 1 ])
370
370
tup = tup [:- 1 ]
@@ -415,8 +415,12 @@ def _plot_args(self, tup, kwargs):
415
415
ncx , ncy = x .shape [1 ], y .shape [1 ]
416
416
if ncx > 1 and ncy > 1 and ncx != ncy :
417
417
raise ValueError (f"x has { ncx } columns but y has { ncy } columns" )
418
- return [func (x [:, j % ncx ], y [:, j % ncy ], kw , kwargs )
419
- for j in range (max (ncx , ncy ))]
418
+ result = (func (x [:, j % ncx ], y [:, j % ncy ], kw , kwargs )
419
+ for j in range (max (ncx , ncy )))
420
+ if return_kwargs :
421
+ return list (result )
422
+ else :
423
+ return [l [0 ] for l in result ]
420
424
421
425
422
426
@cbook ._define_aliases ({"facecolor" : ["fc" ]})
0 commit comments