10000 [Doc] Minor consistency changes and correction of Marker docs by oscargus · Pull Request #27520 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[Doc] Minor consistency changes and correction of Marker docs #27520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions lib/matplotlib/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
``11`` (``CARETDOWNBASE``) |m36| caretdown (centered at base)
``"none"`` or ``"None"`` nothing
``" "`` or ``""`` nothing
``'$...$'`` |m37| Render the string using mathtext.
``"$...$"`` |m37| Render the string using mathtext.
E.g ``"$f$"`` for marker showing the
letter ``f``.
``verts`` A list of (x, y) pairs used for Path
vertices. The center of the marker is
located at (0, 0) and the size is
normalized, such that the created path
is encapsulated inside the unit cell.
path A `~matplotlib.path.Path` instance.
``path`` A `~matplotlib.path.Path` instance.
``(numsides, 0, angle)`` A regular polygon with ``numsides``
sides, rotated by ``angle``.
``(numsides, 1, angle)`` A star-like symbol with ``numsides``
Expand All @@ -64,11 +64,6 @@
rotated by ``angle``.
============================== ====== =========================================

As a deprecated feature, ``None`` also means 'nothing' when directly
constructing a `.MarkerStyle`, but note that there are other contexts where
``marker=None`` instead means "the default marker" (e.g. :rc:`scatter.marker`
for `.Axes.scatter`).

Note that special symbols can be defined via the
:ref:`STIX math font <mathtext>`,
e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer to the
Expand Down Expand Up @@ -227,24 +222,22 @@ def __init__(self, marker,
"""
Parameters
----------
marker : str, array-like, Path, MarkerStyle, or None
- Another instance of *MarkerStyle* copies the details of that
``marker``.
- *None* means no marker. This is the deprecated default.
marker : str, array-like, Path, MarkerStyle
- Another instance of `MarkerStyle` copies the details of that *marker*.
- For other possible marker values, see the module docstring
`matplotlib.markers`.

fillstyle : str, default: :rc:`markers.fillstyle`
One of 'full', 'left', 'right', 'bottom', 'top', 'none'.

transform : transforms.Transform, default: None
transform : `~matplotlib.transforms.Transform`, optional
Transform that will be combined with the native transform of the
marker.

capstyle : `.CapStyle` or %(CapStyle)s, default: None
capstyle : `.CapStyle` or %(CapStyle)s, optional
Cap style that will override the default cap style of the marker.

joinstyle : `.JoinStyle` or %(JoinStyle)s, default: None
joinstyle : `.JoinStyle` or %(JoinStyle)s, optional
Join style that will override the default join style of the marker.
"""
self._marker_function = None
Expand Down Expand Up @@ -309,10 +302,8 @@ def _set_marker(self, marker):

Parameters
----------
marker : str, array-like, Path, MarkerStyle, or None, default: None
- Another instance of *MarkerStyle* copies the details of that
``marker``.
- *None* means no marker.
marker : str, array-like, Path, MarkerStyle
- Another instance of `MarkerStyle` copies the details of that *marker*.
- For other possible marker values see the module docstring
`matplotlib.markers`.
"""
Expand Down Expand Up @@ -388,13 +379,13 @@ def get_user_transform(self):
if self._user_transform is not None:
return self._user_transform.frozen()

def transformed(self, transform: Affine2D):
def transformed(self, transform):
"""
Return a new version of this marker with the transform applied.

Parameters
----------
transform : `~matplotlib.transforms.Affine2D`, default: None
transform : `~matplotlib.transforms.Affine2D`
Transform will be combined with current user supplied transform.
"""
new_marker = MarkerStyle(self)
Expand All @@ -410,10 +401,10 @@ def rotated(self, *, deg=None, rad=None):

Parameters
----------
deg : float, default: None
deg : float, optional
Rotation angle in degrees.

rad : float, default: None
rad : float, optional
Rotation angle in radians.

.. note:: You must specify exactly one of deg or rad.
Expand All @@ -437,14 +428,14 @@ def scaled(self, sx, sy=None):
"""
Return new marker scaled by specified scale factors.

If *sy* is None, the same scale is applied in both the *x*- and
If *sy* is not given, the same scale is applied in both the *x*- and
*y*-directions.

Parameters
----------
sx : float
*X*-direction scaling factor.
sy : float, default: None
sy : float, optional
*Y*-direction scaling factor.
"""
if sy is None:
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/markers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MarkerStyle:

def __init__(
self,
marker: str | ArrayLike | Path | MarkerStyle | None,
marker: str | ArrayLike | Path | MarkerStyle,
fillstyle: FillStyleType | None = ...,
transform: Transform | None = ...,
capstyle: CapStyleType | None = ...,
Expand Down
0