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()