I have the following dataframe, for which I want to create a plotly scatter chart:
dict1 = {'Name':['Tom', 'nick', 'krish', 'jack','jill'],
'Last':[20, 21, 19, 18,15],
'Change':[-1,-5,1,3,-5],
'Color':['#30C030', '#9acd32', '#f08080','#FF1E3E','#FF1E3E']}
df = pd.DataFrame(dict1)
I would like the marker color to be the exact color for each item as listed in the 'color' column, however, when I use the following it assigns default colors based on the value in that column, rather than assigning the actual color listed:
fig = px.scatter(df, x = 'Last', y = 'Change', template = 'plotly_dark',
text = 'Name', color = 'Color'
)
fig.update_traces(textposition='bottom center')
fig