8000 Fix collection legend handlers by tacaswell · Pull Request #7832 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix collection legend handlers #7832

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 3 commits into from
Jan 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next 8000 Next commit
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.
  • Loading branch information
tacaswell committed Jan 15, 2017
commit 9fb4f9bba510f42b376b8e835c453d7ba96c89b1
1 change: 1 addition & 0 deletions lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ def update_from(self, other):
self._facecolors = other._facecolors
self._linewidths = other._linewidths
self._linestyles = other._linestyles
self._us_linestyles = other._us_linestyles
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anywhere that documents that 'us' means unscaled? It's rather an opaque prefix to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, but I would prefer that be done in a seperate PR (created #7837 to track this).

self._pickradius = other._pickradius
self._hatch = other._hatch

Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,9 @@ def update_from(self, other):
self._markeredgecolor = other._markeredgecolor
self._markeredgewidth = other._markeredgewidth
self._dashSeq = other._dashSeq
self._us_dashSeq = other._us_dashSeq
self._dashOffset = other._dashOffset
self._us_dashOffset = other._us_dashOffset
self._dashcapstyle = other._dashcapstyle
self._dashjoinstyle = other._dashjoinstyle
self._solidcapstyle = other._solidcapstyle
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def update_from(self, other):
self._facecolor = other._facecolor
self._fill = other._fill
self._hatch = other._hatch
self._linewidth = other._linewidth
# Use setters, getters where we need the extra work they do.
self.set_linestyle(other._linestyle) # also sets dash properties
# copy the unscaled dash pattern
self._us_dashes = other._us_dashes
self.set_linewidth(other._linewidth) # also sets dash properties
self.set_transform(other.get_data_transform())

def get_extents(self):
Expand Down
0