# Reversed axis when plotting image

**URL:** <https://community.plotly.com/t/reversed-axis-when-plotting-image/53594>\
**Category:** 📊 Plotly Python\
**Created:** [June 5, 2021, 8:50pm UTC](https://community.plotly.com/t/reversed-axis-when-plotting-image/53594 "2021-06-05T20:50:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide\_sd](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/davide_sd/32/12990_2.png) [@Davide\_sd](https://community.plotly.com/u/Davide_sd)\
**Post date:** [June 5, 2021, 8:50pm UTC](https://community.plotly.com/t/reversed-axis-when-plotting-image/53594/1 "2021-06-05T20:50:07Z")

</div>

I’m trying to visualize image-like data, so I’m using `go.Image`. I would also like to have the y-axis going from negative in the bottom to positive in the top. However, it seems like the property `autorange="reversed"` is not working. Is there a way to reverse it when plotting go.Image?

```auto
import plotly.graph_objects as go
import numpy as np

n1, n2 = 200, 100
x = np.linspace(-4, 5, n1)
y = np.linspace(-2, 1, n2)
xx, yy = np.meshgrid(x, y)
zz = np.zeros((*xx.shape, 3), dtype=int)
for i in range(n2):
    for j in range(n1):
        zz[i, j] = ((int((yy[i, j] - yy.min()) / (yy.max() - yy.min()) * 255)), 0, 0)

fig = go.Figure()
fig.add_trace(go.Image(
    x0 = x.min(),
    y0 = y.min(),
    dx = (x.max() - x.min()) / n1,
    dy = (y.max() - y.min()) / n2,
    z=zz
))
fig.update_layout(
    template = "plotly_dark",
    yaxis = dict(
        autorange = "reversed"
    )
)
fig.show()

```
