Reputation: 115
This is my code. I'd like to click the button plot the graph and then remove the graph plotted before plotting a new graph on clicking the button.
columns=[i for i in load_weekday['feed_point_number'].unique()]
selection=widgets.Dropdown(description='Select feed_point_number?')
selection.options=columns
display(selection)
def on_button_clicked(b):
sns.set_style("whitegrid")
sns.set_context(rc={"figure.figsize":(12,9)})
load_weekday.plot(x='time_code',y=selection.value,color='Blue')
button=widgets.Button(description="Plot")
display(button)
button.on_click(on_button_clicked)
Upvotes: 0
Views: 1689