@@ -213,9 +213,9 @@ class _process_plot_var_args:
213
213
an arbitrary number of *x*, *y*, *fmt* are allowed
214
214
"""
215
215
216
- def __init__ (self , command = 'plot ' ):
217
- _api .check_in_list (['plot ' , 'fill ' , 'mirror ' ], command = command )
218
- self .command = command
216
+ def __init__ (self , output = 'Line2D ' ):
217
+ _api .check_in_list (['Line2D ' , 'Polygon ' , 'coordinates ' ], output = output )
218
+ self .output = output
219
219
self .set_prop_cycle (None )
220
220
221
221
def set_prop_cycle (self , cycler ):
@@ -229,7 +229,7 @@ def __call__(self, axes, *args, data=None, return_kwargs=False, **kwargs):
229
229
230
230
for pos_only in "xy" :
231
231
if pos_only in kwargs :
232
- raise _api .kwarg_error (self . command , pos_only )
232
+ raise _api .kwarg_error (inspect . stack ()[ 1 ]. function , pos_only )
233
233
234
234
if not args :
235
235
return
@@ -332,18 +332,18 @@ def _setdefaults(self, defaults, kw):
332
332
if kw .get (k , None ) is None :
333
333
kw [k ] = defaults [k ]
334
334
335
- def _makeline (self , axes , x , y , kw , kwargs ):
335
+ def _make_line (self , axes , x , y , kw , kwargs ):
336
336
kw = {** kw , ** kwargs } # Don't modify the original kw.
337
337
self ._setdefaults (self ._getdefaults (kw ), kw )
338
338
seg = mlines .Line2D (x , y , ** kw )
339
339
return seg , kw
340
340
341
- def _mirror (self , axes , x , y , kw , kwargs ):
341
+ def _make_coordinates (self , axes , x , y , kw , kwargs ):
342
342
kw = {** kw , ** kwargs } # Don't modify the original kw.
343
343
self ._setdefaults (self ._getdefaults (kw ), kw )
344
344
return (x , y ), kw
345
345
346
- def _makefill (self , axes , x , y , kw , kwargs ):
346
+ def _make_polygon (self , axes , x , y , kw , kwargs ):
347
347
# Polygon doesn't directly support unitized inputs.
348
348
x = axes .convert_xunits (x )
349
349
y = axes .convert_yunits (y )
@@ -501,15 +501,15 @@ def _plot_args(self, axes, tup, kwargs, *,
501
501
if y .ndim == 1 :
502
502
y = y [:, np .newaxis ]
503
503
504
- if self .command == 'plot ' :
505
- make_artist = self ._makeline
506
- elif self .command == 'fill ' :
504
+ if self .output == 'Line2D ' :
505
+ make_artist = self ._make_line
506
+ elif self .output == 'Polygon ' :
507
507
kw ['closed' ] = kwargs .get ('closed' , True )
508
- make_artist = self ._makefill
509
- elif self .command == 'mirror ' :
510
- make_artist = self ._mirror
508
+ make_artist = self ._make_polygon
509
+ elif self .output == 'coordinates ' :
510
+ make_artist = self ._make_coordinates
511
511
else :
512
- _api .check_in_list (['plot ' , 'fill ' , 'mirror ' ], command = self .command )
512
+ _api .check_in_list (['Line2D ' , 'Polygon ' , 'coordinates ' ], output = self .output )
513
513
514
514
ncx , ncy = x .shape [1 ], y .shape [1 ]
515
515
if ncx > 1 and ncy > 1 and ncx != ncy :
@@ -1311,7 +1311,7 @@ def __clear(self):
1311
1311
self ._use_sticky_edges = True
1312
1312
1313
1313
self ._get_lines = _process_plot_var_args ()
1314
- self ._get_patches_for_fill = _process_plot_var_args ('fill ' )
1314
+ self ._get_patches_for_fill = _process_plot_var_args ('Polygon ' )
1315
1315
1316
1316
self ._gridOn = mpl .rcParams ['axes.grid' ]
1317
1317
# Swap children to minimize time we spend in an invalid state
0 commit comments