File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -4927,7 +4927,9 @@ def reduce_C_function(C: array) -> float
49274927 # autoscale the norm with current accum values if it hasn't been set
49284928 if norm is not None :
49294929 if norm .vmin is None and norm .vmax is None :
4930- norm .autoscale (accum )
4930+ norm .autoscale_None (accum )
4931+ norm .vmin = np .ma .masked if norm .vmin is None else norm .vmin
4932+ norm .vmax = np .ma .masked if norm .vmax is None else norm .vmax
49314933
49324934 if bins is not None :
49334935 if not np .iterable (bins ):
Original file line number Diff line number Diff line change @@ -901,6 +901,14 @@ def test_hexbin_empty():
901901 ax .hexbin ([], [])
902902
903903
904+ @image_comparison (['hexbin_empty.png' ], remove_text = True )
905+ def test_hexbin_log_empty ():
906+ # From #23922: creating hexbin with log scaling from empty
907+ # dataset raises ValueError
908+ ax = plt .gca ()
909+ ax .hexbin ([], [], bins = 'log' )
910+
911+
904912def test_hexbin_pickable ():
905913 # From #1973: Test that picking a hexbin collection works
906914 fig , ax = plt .subplots ()
You can’t perform that action at this time.
0 commit comments