plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Plotly.express.imshow shows letters behind numbers when number is small (i.e 1.19e-07)

Open Mebu98 opened this issue 3 months ago • 2 comments

While doing a course in statistics I came across the issue where numbers approaching 0 appear as letters instead of their numerical representation when using imshow for heatmaps.

Such as ending in ‘f’ for ‘OP1 - OP4’ and ‘n’ for ‘OP3 - OP4’ as seen below. Is there a way to fix this? While not dealbreaking, since Dunn’s test doesn’t benefit from displaying values below 0.01, it is still weird and unexpected behavior…

Screenshot from Plotly:

Image

Screenshot from console log:

Image

Mebu98 avatar Oct 14 '25 18:10 Mebu98

Thanks for the bug report @Mebu98 - that's definitely an error, but I don't think we'll be able to tackle it any time soon. The simplest workaround is probably to use round() to round off data to (for example) 2 or 3 decimal places before plotting - I realize that's a bit of a hack, but it should work.

gvwilson avatar Oct 28 '25 11:10 gvwilson

I think this is expected behavior for exponentformat SI. You could try to set the exponentformat to 'e' or 'power' .

Why only part of it show the SI prefix, see for a very recent discussion on this and the new SI extended (which still won't cover the e**-120). SI exponentformat ends at -15 arguing that those prefixes users are familiar with, so you see nano and femto but nothing beyond. https://github.com/plotly/plotly.py/issues/4787

mmarras avatar Nov 03 '25 21:11 mmarras