I have been trying to create a 3D surface plot using Plotly with Python3. I am drawing based on the official case, but the case does not explain how to add a title to the colorbar.
I tried running the following command with no success.
fig.update_layout(colorbar=dict(title='Temperature(K)'), titleside='right')
The error display is: Bad property path: colorbar ^^^^^^^^ Also, is there a way to add units to the values on the color bar?
You can specify it in the
go.Surface()constructor directly, eg. :Nb.
colorbar_title_textuses "magic underscore" notation as a shortcut forcolorbar=dict(title=dict(text='...')).See https://plotly.com/python/reference/surface/#surface-colorbar-title-text