Skip to content

Instantly share code, notes, and snippets.

@techzeero
Created March 2, 2022 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techzeero/bedce551a689adeebfe3764c5677cdfa to your computer and use it in GitHub Desktop.
Save techzeero/bedce551a689adeebfe3764c5677cdfa to your computer and use it in GitHub Desktop.
@app.callback(Output(component_id='graph', component_property= 'figure'),
[Input(component_id='dropdown', component_property= 'value')])
def graph_update(dropdown_value):
fig = px.scatter(df[df["species"]==dropdown_value], x="sepal_width", y="sepal_length")
fig.update_layout(title = 'Sapel Length and Width of Different Species',
xaxis_title = 'Sepal Width',
yaxis_title = 'Sepal Length')
return fig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment