From a6ef03e8617a8094f16d3b74256f4a1f360939d4 Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson Date: Sat, 22 Oct 2022 11:07:37 +0200 Subject: [PATCH] Fix partial example --- doc/api/animation_api.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/animation_api.rst b/doc/api/animation_api.rst index 13b0acf026c2..c0f8e724b798 100644 --- a/doc/api/animation_api.rst +++ b/doc/api/animation_api.rst @@ -147,17 +147,17 @@ function. :: def init(): ax.set_xlim(0, 2*np.pi) ax.set_ylim(-1, 1) - return ln, + return line1, def update(frame, ln, x, y): x.append(frame) y.append(np.sin(frame)) - ln.set_data(xdata, ydata) + ln.set_data(x, y) return ln, xdata, ydata = [], [] ani = FuncAnimation( - fig, partial(update, ln=line1, x=xdata, y=ydata), + fig, partial(update, ln=line1, x=[], y=[]), frames=np.linspace(0, 2 * np.pi, 128), init_func=init, blit=True)