Heatmap y-axis is reversed by default, going against standard convention for matrices

Thank you for the quick response! I’m new to plotly and wasn’t aware that px.imshow() outputted the image with the y-axis the usual way. It’s a little odd to me though as for heatmaps having the cartesian y axis, since traditionally heatmaps are a representation of a matrix where individual values are represented as colors, whether that matrix represents an image in your case or a map or whatever else. I can totally understand not wanting to break previous code, the initial philosophy choice is just a bit unusual. As long as the autorange reversal doesn’t cause more wonky behavior I can use that.

The entire reason I ran into this was because I wanted to recreate sklearn’s plot_confusion_matrix as a plotly graph object, including text annotations and some some thin spacing between the tiles but was having some issues figuring it out.

1 Like