@@ -337,11 +337,11 @@ def test_cursor_data():
337337
338338
339339@pytest .mark .parametrize (
340- "data, text_without_colorbar, text_with_colorbar " , [
341- ([[10001 , 10000 ]], "[1e+04]" , "[ 10001]" ),
342- ([[.123 , .987 ]], "[0.123]" , "[0.123]" ),
340+ "data, text " , [
341+ ([[10001 , 10000 ]], "[10001.000 ]" ),
342+ ([[.123 , .987 ]], "[0.123]" ),
343343 ])
344- def test_format_cursor_data (data , text_without_colorbar , text_with_colorbar ):
344+ def test_format_cursor_data (data , text ):
345345 from matplotlib .backend_bases import MouseEvent
346346
347347 fig , ax = plt .subplots ()
@@ -350,15 +350,7 @@ def test_format_cursor_data(data, text_without_colorbar, text_with_colorbar):
350350 xdisp , ydisp = ax .transData .transform ([0 , 0 ])
351351 event = MouseEvent ('motion_notify_event' , fig .canvas , xdisp , ydisp )
352352 assert im .get_cursor_data (event ) == data [0 ][0 ]
353- assert im .format_cursor_data (im .get_cursor_data (event )) \
354- == text_without_colorbar
355-
356- fig .colorbar (im )
357- fig .canvas .draw () # This is necessary to set up the colorbar formatter.
358-
359- assert im .get_cursor_data (event ) == data [0 ][0 ]
360- assert im .format_cursor_data (im .get_cursor_data (event )) \
361- == text_with_colorbar
353+ assert im .format_cursor_data (im .get_cursor_data (event )) == text
362354
363355
364356@image_comparison (['image_clip' ], style = 'mpl20' )
0 commit comments