@@ -214,6 +214,7 @@ class _process_plot_var_args:
214
214
"""
215
215
216
216
def __init__ (self , command = 'plot' ):
217
+ _api .check_in_list (['plot' , 'fill' , 'mirror' ], command = command )
217
218
self .command = command
218
219
self .set_prop_cycle (None )
219
220
@@ -335,6 +336,11 @@ def _makeline(self, axes, x, y, kw, kwargs):
335
336
seg = mlines .Line2D (x , y , ** kw )
336
337
return seg , kw
337
338
339
+ def _mirror (self , axes , x , y , kw , kwargs ):
340
+ kw = {** kw , ** kwargs } # Don't modify the original kw.
341
+ self ._setdefaults (self ._getdefaults (kw ), kw )
342
+ return (x , y ), kw
343
+
338
344
def _makefill (self , axes , x , y , kw , kwargs ):
339
345
# Polygon doesn't directly support unitized inputs.
340
346
x = axes .convert_xunits (x )
@@ -495,9 +501,13 @@ def _plot_args(self, axes, tup, kwargs, *,
495
501
496
502
if self .command == 'plot' :
497
503
make_artist = self ._makeline
498
- else :
504
+ elif self . command == 'fill' :
499
505
kw ['closed' ] = kwargs .get ('closed' , True )
500
506
make_artist = self ._makefill
507
+ elif self .command == 'mirror' :
508
+ make_artist = self ._mirror
509
+ else :
510
+ _api .check_in_list (['plot' , 'fill' , 'mirror' ], command = self .command )
501
511
502
512
ncx , ncy = x .shape [1 ], y .shape [1 ]
503
513
if ncx > 1 and ncy > 1 and ncx != ncy :
0 commit comments