Reverse axis of go.Heatmap

I’m using the plotly go.Heatmap to plot multiple heatmaps in a subplot made by make_subplots(…). I’m struggling to get the axis to be reversed as to represent matrix coordinates opposed to the increasing x,y standard in plotly.
Do anyone have a tips on how to do this?

HI @Simenhu welcome to the forums. Could you elaborate a bit?

If you are refering to the y axis starting in the upper corner or the lower corner, plotly.express heatmap has the parameter origin for that (upper or lower).

Not sure about plotly.graph_objects, though.

Hi, yes, I that’s correct. I tried at first using plotly expres with the px.imshow method, but had a really hard time figuring out how to make a figure with 3 subplots where each of the subplot was a plot from plotly express, with imshow. Would preferably like to use plotly express, as you said.

Do you know how to use px.imhow() in together with subplots, can’t find any examples.

HI @Simenhu ,

here is a basic example:

from plotly.subplots import make_subplots
import plotly.express as px
import numpy as np

def data():
    return np.random.randint(0, 255, size=(100, 100))

rows = 3

fig = make_subplots(rows=rows, cols=1)

for r in range(1, rows + 1):
    fig.add_trace(px.imshow(data(), origin='lower').data[0], row=r, col=1)

fig.show()

creates:
newplot (37)