Ah, so it seems that the change from super().autoscale(np.ma.array(A, mask=(A <= 0))) (which does produce min/max values for a fully masked array) to super().autoscale(in_trf_domain) (where in_trf_domain is a zero-length array) is the key change. I believe this would crash if log-scale is used any time all the bins are zero or negative.
I don't know what the correct solution is; is it as simple as putting a guard in autoscale like in autoscale_None that checks if A has a non-zero size? I don't know if this would have other bad downstream effects.
I suspect adding that guard is the right thing to do. It is impossible to correctly autoscale with no data so it is a bit of an undefined operation. In this case doing anything is better than crashing. It would be best if we still maintained the old behavior.
Putting in a guard (hacking my installation and not running a full test) does work in terms of not crashing, but leaves the hexbin (in particular) with no background rather than the default bluish background. I'm not sure if this is a problem, but it is different from the previous behavior (and the behavior without log scaling), but I don't know what the default values of vmin and vmax used to be in this case.
Activity
greglucas commented on Sep 17, 2022
bisects to: #21989
erykoff commented on Sep 18, 2022
Ah, so it seems that the change from super().autoscale(np.ma.array(A, mask=(A <= 0))) (which does produce min/max values for a fully masked array) to super().autoscale(in_trf_domain) (where in_trf_domain is a zero-length array) is the key change. I believe this would crash if log-scale is used any time all the bins are zero or negative.
I don't know what the correct solution is; is it as simple as putting a guard in autoscale like in autoscale_None that checks if A has a non-zero size? I don't know if this would have other bad downstream effects.
tacaswell commented on Sep 18, 2022
I suspect adding that guard is the right thing to do. It is impossible to correctly autoscale with no data so it is a bit of an undefined operation. In this case doing anything is better than crashing. It would be best if we still maintained the old behavior.
erykoff commented on Sep 18, 2022
Putting in a guard (hacking my installation and not running a full test) does work in terms of not crashing, but leaves the hexbin (in particular) with no background rather than the default bluish background. I'm not sure if this is a problem, but it is different from the previous behavior (and the behavior without log scaling), but I don't know what the default values of vmin and vmax used to be in this case.
QuLogic commented on Sep 23, 2022
Closed by #23944.