10000 Correctly skip colors for nan points given to scatter by dstansby · Pull Request #7570 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Correctly skip colors for nan points given to scatter #7570

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 6 commits into from
Dec 11, 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
10000
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Mask correct color array before scattering
  • Loading branch information
dstansby committed Dec 4, 2016
commit 0b201e60ed6f327e81d3a970836b3b9784e76e7f
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3996,7 +3996,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
colors = None # use cmap, norm after collection is created

# c will be unchanged unless it is the same length as x:
Copy link
Member

Choose a reason for hiding this comment

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

c and colors will be unchanged (why are c and colors different args?)

Copy link
Member

Choose a reason for hiding this comment

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

That is a question you don't want to ask 😈 .

Copy link
Member

Choose a reason for hiding this comment

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

More seriously, there it pre-dates me and is almost certainly to support back compatibility. c can be a scalar, a color, a sequence of colors or a sequence of scalars. colors can be (iirc) a single color or a list of colors.

c comes from scatter being a scalar mappable under the hood and colors comes from scatter returning a collection under the hood.

x, y, s, c = cbook.delete_masked_points(x, y, s, c)
x, y, s, colors = cbook.delete_masked_points(x, y, s, c)

scales = s # Renamed for readability below.

Expand Down
0