Skip to content

Commit 5223f2a

Browse files
Michael Vincent ManninoMichael Vincent Mannino
authored andcommitted
update tests
1 parent 6e86858 commit 5223f2a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pandas/tests/plotting/frame/test_frame_color.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ def test_scatter_with_c_column_name_with_colors(self, cmap):
219219
ax = df.plot.scatter(x=0, y=1, c="species", cmap=cmap)
220220

221221
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()
222228
assert ax.collections[0].colorbar is None
223229

224230
def test_scatter_with_c_column_name_without_colors(self):
@@ -269,7 +275,13 @@ def test_scatter_colors_not_raising_warnings(self):
269275
df = DataFrame({"x": [1, 2, 3], "y": [1, 2, 3]})
270276
with tm.assert_produces_warning(None):
271277
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
273285

274286
def test_scatter_colors_default(self):
275287
df = DataFrame({"a": [1, 2, 3], "b": [1, 2, 3], "c": [1, 2, 3]})

0 commit comments

Comments
 (0)