63
63
rotated by ``angle``.
64
64
============================== ====== =========================================
65
65
66
- ``None`` is the default which means 'nothing', however this table is
67
- referred to from other docs for the valid inputs from marker inputs and in
68
- those cases ``None`` still means 'default' .
66
+ ``None`` also means 'nothing' when directly constructing a `.MarkerStyle`, but
67
+ note that there are other contexts where `` marker=None`` instead means "the
68
+ default marker" (e.g. :rc:`scatter.marker` for `.Axes.scatter`) .
69
69
70
70
Note that special symbols can be defined via the
71
71
:doc:`STIX math font </tutorials/text/mathtext>`,
127
127
"""
128
128
129
129
from collections .abc import Sized
130
+ import inspect
130
131
131
132
import numpy as np
132
133
@@ -216,14 +217,16 @@ class MarkerStyle:
216
217
# TODO: Is this ever used as a non-constant?
217
218
_point_size_reduction = 0.5
218
219
219
- def __init__ (self , marker = None , fillstyle = None ):
220
+ _unset = object () # For deprecation of MarkerStyle(<noargs>).
221
+
222
+ def __init__ (self , marker = _unset , fillstyle = None ):
220
223
"""
221
224
Parameters
222
225
----------
223
- marker : str, array-like, Path, MarkerStyle, or None, default: None
226
+ marker : str, array-like, Path, MarkerStyle, or None
224
227
- Another instance of *MarkerStyle* copies the details of that
225
228
``marker``.
226
- - *None* means no marker.
229
+ - *None* means no marker. This is the deprecated default.
227
230
- For other possible marker values see the module docstring
228
231
`matplotlib.markers`.
229
232
@@ -232,8 +235,19 @@ def __init__(self, marker=None, fillstyle=None):
232
235
"""
233
236
self ._marker_function = None
234
237
self ._set_fillstyle (fillstyle )
238
+ # Remove _unset and signature rewriting after deprecation elapses.
239
+ if marker is self ._unset :
240
+ marker = ""
241
+ _api .warn_deprecated (
242
+ "3.6" , message = "Calling MarkerStyle() with no parameters is "
243
+ "deprecated since %(since)s; support will be removed "
244
+ "%(removal)s. Use MarkerStyle('') to construct an empty "
245
+ "MarkerStyle." )
235
246
self ._set_marker (marker )
236
247
248
+ __init__ .__signature__ = inspect .signature ( # Only for deprecation period.
249
+ lambda self , marker , fillstyle = None : None )
250
+
237
251
def _recache(self ):
238
252
if self ._marker_function is None :
239
253
return
0 commit comments