Created
August 22, 2020 14:46
-
-
Save moritzkoerber/c132675a06f490bf3f0ec467ee369348 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.graph_objects as go | |
fig = go.Figure() | |
fig.update_layout( | |
template="simple_white", | |
xaxis=dict(title_text="Week"), | |
yaxis=dict(title_text="Count"), | |
barmode="stack", | |
) | |
colors = ["#2A66DE", "#FFC32B"] | |
for r, c in zip(df.response.unique(), colors): | |
plot_df = df[df.response == r] | |
fig.add_trace( | |
go.Bar(x=[plot_df.week, plot_df.layout], y=plot_df.cnt, name=r, marker_color=c), | |
) | |
fig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment