I am displaying data using a matplotlib scatterplot:
fig = plt.figure()
ax = fig.add_subplot(111)
sp = ax.scatter(x,y,c=c)
My data updates periodically, however, and I would like to update the plot without having to clear the figure and plot again; I would like to simply "update" the data of the existing plot, but I haven't had any luck finding out how to do this. Is this possible?
EDIT: I should have included that I am also trying to update the color of the points (c
in the above code). I am making a scatter plot of a large collection of (x,y,c)
data where c
is the color/threshold and the user can select the threshold above which the points are displayed and below which they are not. sp.set_offsets(np.c_[x,y])
looks like it works to update the points being displayed (thanks, @ImportanceOfBeingErnest), but I also need to update the c
values.