Skip to content
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

Scatter plot fails for a single point #594

Open
machur opened this issue Oct 26, 2023 · 1 comment
Open

Scatter plot fails for a single point #594

machur opened this issue Oct 26, 2023 · 1 comment

Comments

@machur
Copy link

machur commented Oct 26, 2023

Scatter plot fails for a single point. A work-around is to pass list with the same point twice, but it looks like there's an error with one-element arrays:

Code that fails:

    plt.scatter([0.5, 0.3, 0.2], [0.2, 0.3, 0.5], s=10, color="red")
    plt.scatter([0.4], [0.4], s=10, color="blue")

Erroneous result:
image

Hackish way of plotting:

    plt.scatter([0.5, 0.3, 0.2], [0.2, 0.3, 0.5], s=10, color="red")
    plt.scatter([0.4, 0.4], [0.4, 0.4], s=10, color="blue")  # doubled point

Result as expected:
image

@JasonGross
Copy link

This is presumably caused by

is_contour = len(dd) == 1
being a bad proxy for "is it a contour"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants