update the figure