Hi! I’m trying to make a grouped + stacked bar chart using plotly express. My dataframe looks like this
I have used the following code to build the plot:
color4g=[‘rgb(213,3,85)’,‘rgb(255,152,0)’,‘rgb(44,198,190)’,‘rgb(72,68,242)’]
color4gRoaming=[‘rgba(213,3,85,0.5)’,‘rgba(255,152,0,0.5)’,‘rgba(44,198,190,0.5)’,‘rgba(72,68,242,0.5)’]
fig= px.bar(df, x=‘Provider’, y=[‘4G (%)’,‘4G Roaming (%)’],
color=‘Aggregate Date’, barmode=‘group’,color_discrete_sequence=color4g+color4gRoaming)
which displays the desired plot, however, I have not found the correct way to differentiate the colors of the values from the first column (‘4G (%)’) from the second column (‘4G Roaming (%)’).
I need that the colors from the ‘4G Roaming (%)’ column to be an opacity version of the ones of ‘4G (%)’, and for such I’m using explicitly the command color_discrete_sequence=color4g+color4gRoaming, however that does not seem to be working.
Any ideas for a solution?
Thanks in advance!