@@ -117,9 +117,6 @@ def __call__(self, ax, renderer):
117
117
self ._transform - ax .figure .transSubfigure )
118
118
119
119
120
- _FORMAT_UNSET = 'None'
121
-
122
-
123
120
def _process_plot_format (fmt ):
124
121
"""
125
122
Convert a MATLAB style color/line style format string to a (*linestyle*,
@@ -134,7 +131,7 @@ def _process_plot_format(fmt):
134
131
135
132
The format is absolute in the sense that if a linestyle or marker is not
136
133
defined in *fmt*, there is no line or marker. This is expressed by
137
- returning _FORMAT_UNSET for the respective quantity.
134
+ returning 'none' for the respective quantity.
138
135
139
136
See Also
140
137
--------
@@ -203,9 +200,9 @@ def _process_plot_format(fmt):
203
200
if linestyle is None and marker is None :
204
201
linestyle = mpl .rcParams ['lines.linestyle' ]
205
202
if linestyle is None :
206
- linestyle = _FORMAT_UNSET
203
+ linestyle = 'none'
207
204
if marker is None :
208
- marker = _FORMAT_UNSET
205
+ marker = 'none'
209
206
210
207
return linestyle , marker , color
211
208
@@ -471,13 +468,17 @@ def _plot_args(self, tup, kwargs, return_kwargs=False):
471
468
# check for conflicts between fmt and kwargs
472
469
if (fmt .lower () != 'none'
473
470
and prop_name in kwargs
474
- and val != _FORMAT_UNSET ):
471
+ and val != 'none' ):
475
472
# Technically ``plot(x, y, 'o', ls='--')`` is a conflict
476
473
# because 'o' implicitly unsets the linestyle
477
- # (linestyle=_FORMAT_UNSET ).
474
+ # (linestyle='none' ).
478
475
# We'll gracefully not warn in this case because an
479
476
# explicit set via kwargs can be seen as intention to
480
477
# override an implicit unset.
478
+ # Note: We don't val.lower() != 'none' because val is not
479
+ # necessarily a string (can be a tuple for colors). This
480
+ # is safe, because *val* comes from _process_plot_format()
481
+ # which only returns lowercase 'none'.
481
482
_api .warn_external (
482
483
f"{ prop_name } is redundantly defined by the "
483
484
f"'{ prop_name } ' keyword argument and the fmt string "
0 commit comments