Last active
January 12, 2021 14:59
-
-
Save justinhchae/9cfbc053b9bce786013fcc5bc7e9d2b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
import plotly_express as px | |
# group the dataframe | |
group = df.groupby('types') | |
# create a blank canvas | |
fig = go.Figure() | |
# each group iteration returns a tuple | |
# (group name, dataframe) | |
for group_name, df in group: | |
fig.add_trace( | |
go.Scatter( | |
x=df['dates'] | |
, y=df['count'] | |
, fill='tozeroy' | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment