i am looking for a solution to use a dict like :
colors={
"Oxygen": "#bf230f",
"Hydrogen": "#19848c",
"Carbon_Dioxide": "#d94f3d",
"Nitrogene": "#8c2d20"}
instead of the list colors in the following example
import plotly.graph_objects as go
colors = ['gold', 'mediumturquoise', 'darkorange', 'lightgreen']
fig = go.Figure(data=[go.Pie(labels=['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen'],
values=[4500,2500,1053,500])])
fig.update_traces(hoverinfo='label+percent', textinfo='value', textfont_size=20,
marker=dict(colors=colors, line=dict(color='#000000', width=2)))
fig.show()
in plotly express this is possible with "color_discrete_map=", but i have to use graph.objects. thanks for help!
