-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Misc. cleanups. #12956
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
Misc. cleanups. #12956
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -657,7 +657,7 @@ def set_data(self, *args): | |
*args : (N, 2) array or two 1D arrays | ||
""" | ||
if len(args) == 1: | ||
x, y = args[0] | ||
(x, y), = args | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if that's really better in this context. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer this form as it's immediately clear that you're not dropping anything from args, i.e. that single line also asserts that args has length 1. (Yes, it's redundant with the line just above, but I still think it helps the readability.) |
||
else: | ||
x, y = args | ||
|
||
|
@@ -763,8 +763,8 @@ def draw(self, renderer): | |
self.ind_offset = 0 # Needed for contains() method. | ||
if self._subslice and self.axes: | ||
x0, x1 = self.axes.get_xbound() | ||
i0, = self._x_filled.searchsorted([x0], 'left') | ||
i1, = self._x_filled.searchsorted([x1], 'right') | ||
i0 = self._x_filled.searchsorted(x0, 'left') | ||
i1 = self._x_filled.searchsorted(x1, 'right') | ||
subslice = slice(max(i0 - 1, 0), i1 + 1) | ||
self.ind_offset = subslice.start | ||
self._transform_path(subslice) | ||
|
Uh oh!
There was an error while loading. Please reload this page.