Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fb4f9b

Browse files
committed
MNT: copy unscaled dash data in update_from
As part of scaling dashes with linewidth, unscaled versions of the dash pattern are now tracked. Make sure we copy these as well.
1 parent be4b213 commit 9fb4f9b

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/matplotlib/collections.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ def update_from(self, other):
788788
self._facecolors = other._facecolors
789789
self._linewidths = other._linewidths
790790
self._linestyles = other._linestyles
791+
self._us_linestyles = other._us_linestyles
791792
self._pickradius = other._pickradius
792793
self._hatch = other._hatch
793794

lib/matplotlib/lines.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,9 @@ def update_from(self, other):
13191319
self._markeredgecolor = other._markeredgecolor
13201320
self._markeredgewidth = other._markeredgewidth
13211321
self._dashSeq = other._dashSeq
1322+
self._us_dashSeq = other._us_dashSeq
13221323
self._dashOffset = other._dashOffset
1324+
self._us_dashOffset = other._us_dashOffset
13231325
self._dashcapstyle = other._dashcapstyle
13241326
self._dashjoinstyle = other._dashjoinstyle
13251327
self._solidcapstyle = other._solidcapstyle

lib/matplotlib/patches.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ def update_from(self, other):
199199
self._facecolor = other._facecolor
200200
self._fill = other._fill
201201
self._hatch = other._hatch
202-
self._linewidth = other._linewidth
203-
# Use setters, getters where we need the extra work they do.
204-
self.set_linestyle(other._linestyle) # also sets dash properties
202+
# copy the unscaled dash pattern
203+
self._us_dashes = other._us_dashes
204+
self.set_linewidth(other._linewidth) # also sets dash properties
205205
self.set_transform(other.get_data_transform())
206206

207207
def get_extents(self):

0 commit comments

Comments
 (0)