Skip to content
3 changes: 1 addition & 2 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,7 @@ def update_from(self, other):
self._solidjoinstyle = other._solidjoinstyle

self._linestyle = other._linestyle
self._marker = MarkerStyle(other._marker.get_marker(),
other._marker.get_fillstyle())
self._marker = MarkerStyle(marker=other._marker)
self._drawstyle = other._drawstyle

def set_dash_joinstyle(self, s):
Expand Down
21 changes: 14 additions & 7 deletions lib/matplotlib/markers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
r"""
Functions to handle markers; used by the marker functionality of
`~matplotlib.axes.Axes.plot` and `~matplotlib.axes.Axes.scatter`.
`~matplotlib.axes.Axes.plot`, `~matplotlib.axes.Axes.scatter`, and
`~matplotlib.axes.Axes.errorbar`.

All possible markers are defined here:

Expand Down Expand Up @@ -216,9 +217,12 @@ def __init__(self, marker=None, fillstyle=None):
"""
Parameters
----------
marker : str or array-like or None, default: None
*None* means no marker. For other possible marker values see the
module docstring `matplotlib.markers`.
marker : str, array-like, Path, MarkerStyle, or None, default: None
- Another instance of *MarkerStyle* copies the details of that
``marker``.
- *None* means no marker.
- For other possible marker values see the module docstring
`matplotlib.markers`.

fillstyle : str, default: 'full'
One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
Expand Down Expand Up @@ -283,9 +287,12 @@ def set_marker(self, marker):

Parameters
----------
marker : str or array-like or None, default: None
*None* means no marker. For other possible marker values see the
module docstring `matplotlib.markers`.
marker : str, array-like, Path, MarkerStyle, or None, default: None
- Another instance of *MarkerStyle* copies the details of that
``marker``.
- *None* means no marker.
- For other possible marker values see the module docstring
`matplotlib.markers`.
"""
if (isinstance(marker, np.ndarray) and marker.ndim == 2 and
marker.shape[1] == 2):
Expand Down
8 changes: 8 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,14 @@ def test_arc_ellipse():
ax.add_patch(e2)


def test_marker_as_markerstyle():
fix, ax = plt.subplots()
m = mmarkers.MarkerStyle('o')
ax.plot([1, 2, 3], [3, 2, 1], marker=m)
ax.scatter([1, 2, 3], [4, 3, 2], marker=m)
ax.errorbar([1, 2, 3], [5, 4, 3], marker=m)


@image_comparison(['markevery'], remove_text=True)
def test_markevery():
x = np.linspace(0, 10, 100)
Expand Down