@@ -242,6 +242,30 @@ def test_scatter3d_color():
242242 color = 'b' , marker = 's' )
243243
244244
245+ @check_figures_equal (extensions = ['png' ])
246+ def test_scatter3d_size (fig_ref , fig_test ):
247+ """Test that large markers in correct position (issue #18135)"""
248+ x = np .arange (10 )
249+ x , y = np .meshgrid (x , x )
250+ z = np .arange (100 ).reshape (10 , 10 )
251+
252+ s = np .full (z .shape , 5 )
253+ s [0 , 0 ] = 100
254+ s [- 1 , 0 ] = 100
255+ s [0 , - 1 ] = 100
256+ s [- 1 , - 1 ] = 100
257+
258+ ax_ref = fig_ref .gca (projection = '3d' )
259+ ax_test = fig_test .gca (projection = '3d' )
260+
261+ small = np .ma .masked_array (z , s == 100 , dtype = float )
262+ large = np .ma .masked_array (z , s != 100 , dtype = float )
263+
264+ ax_ref .scatter (x , y , large , s = 100 , c = "C0" , alpha = 1 )
265+ ax_ref .scatter (x , y , small , s = 5 , c = "C0" , alpha = 1 )
266+ ax_test .scatter (x , y , z , s = s , c = "C0" , alpha = 1 )
267+
268+
245269@pytest .mark .parametrize ('azim' , [- 50 , 130 ]) # yellow first, blue first
246270@check_figures_equal (extensions = ['png' ])
247271def test_marker_draw_order_data_reversed (fig_test , fig_ref , azim ):
0 commit comments