Is there a way to change the orientation of the colorbar in Plotly heatmap? Setting the orientation in the layout does not do anything:
go.Layout(
legend=dict(
orientation="h")
)
It doesn't even give me an error message. I have also tried change the orientation in the colorbar directly:
colorbar = dict(
orientation="h"
)
but I get the error message that 'orientation' is not a valid property of 'plotly.graph_objs.heatmap.ColorBar'.
I know how to set the position of the colorbar and I have looked the valid properties of the colorbar but could not find a way to set its orientation. Is this possible?
Set the orientation of the colorbar.
As per the Plotly Documentation:
# For the vertical orintation
fig.update_traces(colorbar_orientation='v', selector=dict(type='heatmap'))
# For the horizontal orintation
fig.update_traces(colorbar_orientation='h', selector=dict(type='heatmap'))
Default: "v" #vertical
I don't believe so. According to this open issue and the response from Chriddyp (co-founder of Plotly), a horizontal colorbar has not been implemented but this feature may be added in future releases of Plotly.
If you really need it— I suppose you can try to draw the colorbar yourself using annotations but that's admittedly a lot of work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With