Skip to content

Scatter plot fails for a single point #594

@machur

Description

@machur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions