8000 Deeper marker copies in Line2D update_from · matplotlib/matplotlib@9efef4e · GitHub
[go: up one dir, main page]

Skip to content

Commit 9efef4e

Browse files
committed
Deeper marker copies in Line2D update_from
Markers already support a copy construction: `MarkerStyle.set_marker` accepts other instances of `MarkerStyle`. However, some Artists, when copying markers, instead construct the copy from the other instance's `get_marker` and `get_fillstyle` methods. This destroys (unsupported) manipulations the user might make to the marker, as discovered in issue #18600. By switching constructors, we can get a more faithful copy without explicitly relying on any of `MarkerStyle`'s private methods in places they do not belong.
1 parent f9d2918 commit 9efef4e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/lines.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,7 @@ def update_from(self, other):
12991299
self._solidjoinstyle = other._solidjoinstyle
13001300

13011301
self._linestyle = other._linestyle
1302-
self._marker = MarkerStyle(other._marker.get_marker(),
1303-
other._marker.get_fillstyle())
1302+
self._marker = MarkerStyle(marker=other._marker)
13041303
self._drawstyle = other._drawstyle
13051304

13061305
def set_dash_joinstyle(self, s):

0 commit comments

Comments
 (0)
0