Inver Y axis for line plot

I have a dataset which is a time series profile showing temperature along depth - the depth is represented with positive numbers - I need to plot it inverting those values so that they will invert the plot along the Y axis- I tried to use invert_yaxis=True but seems such option is not available :

url = 'https://thredds.met.no/thredds/dodsC/arcticdata/frost2netcdf-permafrost/SN99927/SN99927-aggregated.ncml'
ds = xr.open_dataset(str(url).strip())
ds['soil_temperature'].where(ds['soil_temperature'] != 9.96921e36).hvplot.line(y='depth', invert_yaxis=True)

will return:

param.main: invert_yaxis option not found for line plot with bokeh

any clue on how can I get the plot with the Y axis flipped?

Does this work?

ds['soil_temperature'].where(ds['soil_temperature'] != 9.96921e36).hvplot.line(y='depth').opts(invert_yaxis=True)

Hi, thanks a lot, this works as expected but I got confused as my main issue was that I was also using the hvplot.line(**axis_arguments) option. I didn’t noticed this was returning a panel object and I was no longer able to appy holoviews.opts() directly.

I fixed my code by accessing the holoview object with the following code:

import xarray as xr
import holoviews as hv
import hvplot.xarray

hv.extension("bokeh")

url = 'https://thredds.met.no/thredds/dodsC/arcticdata/frost2netcdf-permafrost/SN99927/SN99927-aggregated.ncml'

x = 'soil_temperature' 
y = 'depth'
title = "Title"

axis_arguments = {'x': x, 'y': y, 'grid':True, 'title': title, 'widget_location': 'bottom', 'responsive': False}

ds = xr.open_dataset(str(url).strip())
plot = ds[x].where(ds[x] != 9.96921e36).hvplot.line(**axis_arguments)
plot[0].object.opts(invert_yaxis=True)

plot