@@ -219,6 +219,12 @@ def test_scatter_with_c_column_name_with_colors(self, cmap):
219
219
ax = df .plot .scatter (x = 0 , y = 1 , c = "species" , cmap = cmap )
220
220
221
221
assert len (np .unique (ax .collections [0 ].get_facecolor (), axis = 0 )) == 3 # r/g/b
222
+ assert (
223
+ np .unique (ax .collections [0 ].get_facecolor (), axis = 0 )
224
+ == np .array (
225
+ [[0.0 , 0.0 , 1.0 , 1.0 ], [0.0 , 0.5 , 0.0 , 1.0 ], [1.0 , 0.0 , 0.0 , 1.0 ]]
226
+ ) # r/g/b
227
+ ).all ()
222
228
assert ax .collections [0 ].colorbar is None
223
229
224
230
def test_scatter_with_c_column_name_without_colors (self ):
@@ -269,7 +275,13 @@ def test_scatter_colors_not_raising_warnings(self):
269
275
df = DataFrame ({"x" : [1 , 2 , 3 ], "y" : [1 , 2 , 3 ]})
270
276
with tm .assert_produces_warning (None ):
271
277
ax = df .plot .scatter (x = "x" , y = "y" , c = "b" )
272
- assert len (np .unique (ax .collections [0 ].get_facecolor (), axis = 0 )) == 1 # b
278
+ assert (
279
+ len (np .unique (ax .collections [0 ].get_facecolor (), axis = 0 )) == 1
280
+ ) # blue
281
+ assert (
282
+ np .unique (ax .collections [0 ].get_facecolor (), axis = 0 )
283
+ == np .array ([[0.0 , 0.0 , 1.0 , 1.0 ]])
284
+ ).all () # blue
273
285
274
286
def test_scatter_colors_default (self ):
275
287
df = DataFrame ({"a" : [1 , 2 , 3 ], "b" : [1 , 2 , 3 ], "c" : [1 , 2 , 3 ]})
0 commit comments