Plotting an NECDF file using xarray results in the correct orientation, but plotting it with Plotly Express causes it to be upside down

Plotting with ‘’ is upside down. With xarray, it is plotting correctly. Is the problem with the file? I appreciate your help.

nc file here: BR-DWGD/exemplos/ at main · AlexandreCandidoXavier/BR-DWGD · GitHub

import as px
import xarray as xr
import as pio
pio.renderers.default = "browser"

tmax = xr.open_mfdataset("")

# work correct

# does not work correct
fig = px.imshow(tmax['Tmax'], aspect='equal')


Screenshot from 2024-06-07 15-15-00


Hey @alexandre welcome to the forums.

Your data is fine, px.imshow() has this as it’s default behaviour. You can either use the origin parameter of px.imshow() or use go.Heatmap()

See also:

It’s working fine. Thanks!

1 Like