Black Lives Matter. Please consider donating to Black Girls Code today.

NaN appearing in Hoverdata

I noticed some strange behavior when plotting data with error bars along with data not containing error bars.

Plotly appears to add “NaN” where no error data is provided or the error data is 0

Not a big issue really but I thought I would mention it

The data I’m plotting is

50Cr (n,2n) TALYS 1.74
Energy (eV), Cross section (barns)
1.3262900e+7 0.0000000e+0
1.3500000e+7 1.3883700e-3
1.4000000e+7 1.0078600e-2
1.4500000e+7 2.3977600e-2
1.5000000e+7 4.0320700e-2
1.6000000e+7 6.9444500e-2
1.7000000e+7 8.8501400e-2
1.8000000e+7 9.9328300e-2
1.9000000e+7 1.0519000e-1
2.0000000e+7 1.0899500e-1
2.1000000e+7 1.1158700e-1
2.2000000e+7 1.1356500e-1
2.3000000e+7 1.1554100e-1
2.4000000e+7 1.1674000e-1
2.5000000e+7 1.1585300e-1
2.6000000e+7 1.1198800e-1
2.7000000e+7 1.0677500e-1
2.8000000e+7 1.0122200e-1
2.9000000e+7 9.5899700e-2
3.0000000e+7 9.1722800e-2
3.0000000e+7 0.0000000e+0
2.0000000e+8 0.0000000e+0

50Cr (n,2n) EXFOR Ikeda 1988
Energy (eV), Cross section (barns), error in energy, error in cross section
1.5010000e+7 4.6500000e-2 0.0000000e+0 3.7000000e-3
1.4720000e+7 3.4300000e-2 0.0000000e+0 2.8000000e-3
1.4470000e+7 2.2800000e-2 0.0000000e+0 1.9000000e-3
1.4250000e+7 1.6500000e-2 0.0000000e+0 1.3000000e-3
1.4000000e+7 8.2700000e-3 0.0000000e+0 7.2000000e-4
1.3780000e+7 4.2100000e-3 0.0000000e+0 3.6000000e-4
1.3680000e+7 1.7300000e-3 0.0000000e+0 3.2000000e-4

Thanks very much.

Looks like the problem is that our hover text labels tried to convert log(0) to text which leads to NaNs.

If you care about how and/or when this bug will be fixed, please subscribe to for the latest info.