python matplotlib -- regenerate graph?
from matplotlib.widgets import Button                                                                                      
real_points = plt.axes().scatter(x=xpts, y=ypts, alpha=.4, s=size, c='green', label='real data')                        
#Reset Button
#rect = [left, bottom, width, height]
reset_axis = plt.axes([0.4, 0.15, 0.1, 0.04])
button = Button(ax=reset_axis, label='Reset', color='lightblue' , hovercolor='0.975')                                      
def reset(event):
    real_points.remove()                                                                                                   
button.on_clicked(reset)                                                                                                   
plt.show()
I have a python function that generates a list with random values.
After I call this function, I call another function that plots the random values using matplotlib.
I want to be able to click some key on the keyboard / mouse, and have the following happen:
(1)  a new list of random values will be re-generated
(2)  the values from (1) will be plotted (replacing the current matplotlib chart)
Meaning, I want to be able to view new charts with a click of a button. How do I go about doing this in python?