Colorbar label position


With new bokeh version, the colorbar label finally is updated! How do I move the colorbar label to the right side and center it?

import xarray as xr
import hvplot.xarray
ds = xr.tutorial.open_dataset("air_temperature")
ds.hvplot('lon', 'lat').opts(clabel="yay colorbar")
1 Like
import xarray as xr
import hvplot.xarray
ds = xr.tutorial.open_dataset("air_temperature")
ds.hvplot('lon', 'lat').opts(clabel="yay colorbar", colorbar_opts={'title_text_baseline': "middle"})

But the colorbar labels all disappear

import xarray as xr
import hvplot.xarray
ds = xr.tutorial.open_dataset("air_temperature")
ds.hvplot('lon', 'lat').opts(clabel="yay colorbar", colorbar_opts={'title_standoff': -150})

But it doesn’t pad

Did you get solution?

Don’t really remember unfortunately :frowning:

You can add padding. Unfortunately it will be applied to the colorbar and not the title.

import panel as pn
import xarray as xr
import hvplot.xarray
pn.extension()
ds = xr.tutorial.open_dataset("air_temperature")
plot = ds.hvplot('lon', 'lat').opts(clabel="yay colorbar", colorbar_opts={'title_standoff': -150, 'padding': 30})

pn.panel(plot).servable()

See holoviews.bokeh Package — HoloViews v1.15.0 for more info.

Thank you for your reply, I also forget some little problems I have solved before. Next time I still struggle with them.

Thanks a lot :grin:, A paper review thinks the color bar title at the original poison is strange, I will try this.