@@ -1765,6 +1765,18 @@ def test_scatter_invalid_color(self, fig_test, fig_ref):
17651765 ax .scatter ([0 , 2 ], [0 , 2 ], c = [1 , 2 ], s = [1 , 3 ], cmap = cmap )
17661766 ax .scatter ([1 , 3 ], [1 , 3 ], s = [2 , 4 ], color = "k" )
17671767
1768+ @check_figures_equal (extensions = ["png" ])
1769+ def test_scatter_no_invalid_color (self , fig_test , fig_ref ):
1770+ # With plotninfinite=False we plot only 2 points.
1771+ ax = fig_test .subplots ()
1772+ cmap = plt .get_cmap ("viridis" , 16 )
1773+ cmap .set_bad ("k" , 1 )
1774+ ax .scatter (range (4 ), range (4 ),
1775+ c = [1 , np .nan , 2 , np .nan ], s = [1 , 2 , 3 , 4 ],
1776+ cmap = cmap , plotnonfinite = False )
1777+ ax = fig_ref .subplots ()
1778+ ax .scatter ([0 , 2 ], [0 , 2 ], c = [1 , 2 ], s = [1 , 3 ], cmap = cmap )
1779+
17681780 # Parameters for *test_scatter_c*. NB: assuming that the
17691781 # scatter plot will have 4 elements. The tuple scheme is:
17701782 # (*c* parameter case, exception regexp key or None if no exception)
@@ -5759,22 +5771,6 @@ def test_color_length_mismatch():
57595771 ax .scatter (x , y , c = [c_rgb ] * N )
57605772
57615773
5762- # The following test is based on the old behavior of deleting bad points.
5763- # def test_scatter_color_masking():
5764- # x = np.array([1, 2, 3])
5765- # y = np.array([1, np.nan, 3])
5766- # colors = np.array(['k', 'w', 'k'])
5767- # linewidths = np.array([1, 2, 3])
5768- # s = plt.scatter(x, y, color=colors, linewidths=linewidths)
5769- #
5770- # facecolors = s.get_facecolors()
5771- # linecolors = s.get_edgecolors()
5772- # linewidths = s.get_linewidths()
5773- # assert_array_equal(facecolors[1], np.array([0, 0, 0, 1]))
5774- # assert_array_equal(linecolors[1], np.array([0, 0, 0, 1]))
5775- # assert linewidths[1] == 3
5776-
5777-
57785774def test_eventplot_legend ():
57795775 plt .eventplot ([1.0 ], label = 'Label' )
57805776 plt .legend ()
0 commit comments