Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Plotting three points using scatter results in wrong color - 1.4.3 #5377

Closed
Milestone
@liujimj

Description

@liujimj

I'm running this on Windows 10 / Anaconda Python 3.4.3 / jupyter iPython 4

Here's some repro code:

importmatplotlib.pyplotaspltimportnumpyasnpfig=plt.figure(1)ax=plt.axes([0.,0.,1.,1.])points=np.random.rand(2,2)# plot 2 points, totally fineax.scatter(points[0],points[1],c=[1,0,0],s=200)points=np.random.rand(2,3)# plot 3 points, hopelessly brokenax.scatter(points[0],points[1],c=[0,1,0],s=200)points=np.random.rand(2,3)# plot 3 points with string color, totally okax.scatter(points[0],points[1],c='g',s=200)points=np.random.rand(2,4)# plot 4 points, totally fineax.scatter(points[0],points[1],c=[0,0,1],s=200)plt.show()

Here's what I get:

download 1

As you can see, plotting 2, 4, or any other number of points usingax.scatter is fine, but graphing 3 points while using RGB color array results in two points as black, and one point as white, instead of using the specified color.

Here's an example on a real dataset. As you can see, it also messes with the legend color. It's hard to diagnose the issue because it's completely non-obvious that the number of points plotted is what triggers the bug.
download 2

I was pulling my hair out for awhile until I realized that the problem only manifested itself on series that had 3 members.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp