6363 rotated by ``angle``.
6464============================== ====== =========================================
6565
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`) .
6969
7070Note that special symbols can be defined via the
7171:doc:`STIX math font </tutorials/text/mathtext>`,
127127"""
128128
129129from collections .abc import Sized
130+ import inspect
130131
131132import numpy as np
132133
@@ -216,14 +217,16 @@ class MarkerStyle:
216217 # TODO: Is this ever used as a non-constant?
217218 _point_size_reduction = 0.5
218219
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 ):
220223 """
221224 Parameters
222225 ----------
223- marker : str, array-like, Path, MarkerStyle, or None, default: None
226+ marker : str, array-like, Path, MarkerStyle, or None
224227 - Another instance of *MarkerStyle* copies the details of that
225228 ``marker``.
226- - *None* means no marker.
229+ - *None* means no marker. This is the deprecated default.
227230 - For other possible marker values see the module docstring
228231 `matplotlib.markers`.
229232
@@ -232,8 +235,19 @@ def __init__(self, marker=None, fillstyle=None):
232235 """
233236 self ._marker_function = None
234237 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." )
235246 self ._set_marker (marker )
236247
248+ __init__ .__signature__ = inspect .signature ( # Only for deprecation period.
249+ lambda self , marker , fillstyle = None : None )
250+
237251 def _recache (self ):
238252 if self ._marker_function is None :
239253 return
0 commit comments