8000 Handle nan/masked values Axes.vlines and hlines by phobson · Pull Request #7408 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Handle nan/masked values Axes.vlines and hlines #7408

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
Nov 8, 2016
Merged
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
Prev Previous commit
remove masked/invalid points after forcing to iterable
  • Loading branch information
phobson committed Nov 8, 2016
commit 1b3fb65219e79d3a5e114be564692b9d68a97b10
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,15 +966,15 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
xmin = self.convert_xunits(xmin)
xmax = self.convert_xunits(xmax)

y, xmin, xmax = cbook.delete_masked_points(y, xmin, xmax)

if not iterable(y):
y = [y]
if not iterable(xmin):
xmin = [xmin]
if not iterable(xmax):
xmax = [xmax]

y, xmin, xmax = cbook.delete_masked_points(y, xmin, xmax)

y = np.ravel(y)
xmin = np.resize(xmin, y.shape)
xmax = np.resize(xmax, y.shape)
Expand Down Expand Up @@ -1048,15 +1048,15 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
ymin = self.convert_yunits(ymin)
ymax = self.convert_yunits(ymax)

x, ymin, ymax = cbook.delete_masked_points(x, ymin, ymax)

if not iterable(x):
x = [x]
if not iterable(ymin):
ymin = [ymin]
if not iterable(ymax):
ymax = [ymax]

x, ymin, ymax = cbook.delete_masked_points(x, ymin, ymax)

x = np.ravel(x)
ymin = np.resize(ymin, x.shape)
ymax = np.resize(ymax, x.shape)
Expand Down
0