Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
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:
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.
I was pulling my hair out for awhile until I realized that the problem only manifested itself on series that had 3 members.