Hi there
I have adapted a line plot color dictionary syntax in the hope that it would work for a horizontal bar plot - but unfortunately it doesnt. Can anybody tell me how to use a dictionary to colour the bars?
I also want the order to be longest bar at the top (as the order specified here) - but it reverses it for some reason?
thanks a lot
import plotly.graph_objects as go
colordict={‘www.sat’: ‘orange’,
‘www.pr’: ‘purple’,
‘payments.p’: ‘violet’,
‘www.pro’: ‘green’,
‘www.prov’: ‘lightgreen’,
‘www.v’: ‘blue’,
‘www.c’: ‘aqua’,
‘www.a’: ‘brown’,
‘ork’: ‘goldenrod’}
fig = go.Figure(go.Bar(
x=[232,204,177,153,145,130],
y= [‘www.sat’,
‘payments.p’,
‘www.prov’,
‘www.c’,
‘www.pro’,
‘www.v’],
orientation=‘h’),color_discrete_map=colordict)
fig.show()