I have netcdf file of ocean temperature with lat, lon, time and depth. I would like to plot a time averaged 3D plot
For that I have written the following code
import netCDF4 as nc
import numpy as np
import plotly.graph_objects as go
fh=‘ocean_data_sonyr.nc’
ds = nc.Dataset(fh)
lons=ds.variables[‘lon’][30:120]
lats=ds.variables[‘lat’][-40:40]
levs=ds.variables[‘depth’][:]
time=ds.variables[‘time’][1:1]
sst=ds.variables[‘temperature’][:]
lon, lat, lev = np.meshgrid(lons, lats, levs)
fig = go.Figure(data=[go.Mesh3d(x=lon, y=lat, z=lev, color=‘lightpink’, opacity=0.50)])
fig.show()
It does not show any error not even any diagram
kindly let me know where I am wrong