From f4fe3e18ace21b01825f75e5d55ae8da02172a8e Mon Sep 17 00:00:00 2001 From: Kostya Farber Date: Wed, 5 Oct 2022 13:30:45 +0100 Subject: [PATCH 1/3] add simple animation scatter plot --- examples/animation/simple_scatter.py | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/animation/simple_scatter.py diff --git a/examples/animation/simple_scatter.py b/examples/animation/simple_scatter.py new file mode 100644 index 000000000000..d8337b8627aa --- /dev/null +++ b/examples/animation/simple_scatter.py @@ -0,0 +1,31 @@ +""" +====================== +Animated scatter plot +====================== + +""" +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.animation as animation + +fig, ax = plt.subplots() +ax.set_xlim([0, 10]) + +scat = ax.scatter(1, 0) +x = np.linspace(0, 10) + + +def animate(i): + scat.set_offsets((x[i], 0)) + return scat, + +ani = animation.FuncAnimation(fig, animate, repeat=True, + frames=len(x) - 1, interval=50) + +# To save the animation using Pillow as a gif +# writer = animation.PillowWriter(fps=15, +# metadata=dict(artist='Me'), +# bitrate=1800) +# ani.save('scatter.gif', writer=writer) + +plt.show() From d577ca269742aeccba594e5dd13e2d6bc61a7a1a Mon Sep 17 00:00:00 2001 From: Kostya Farber Date: Wed, 12 Oct 2022 08:29:35 +0100 Subject: [PATCH 2/3] change title to Animated Scatter Saved as Gif --- examples/animation/simple_scatter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/animation/simple_scatter.py b/examples/animation/simple_scatter.py index d8337b8627aa..ec82fae19f4f 100644 --- a/examples/animation/simple_scatter.py +++ b/examples/animation/simple_scatter.py @@ -1,7 +1,7 @@ """ -====================== -Animated scatter plot -====================== +============================= +Animated Scatter Saved as Gif +============================= """ import numpy as np From 7424ce35290933a2fa66b5815055590409f084f7 Mon Sep 17 00:00:00 2001 From: Kostya Farber Date: Thu, 13 Oct 2022 09:31:03 +0100 Subject: [PATCH 3/3] change title to sentence case --- examples/animation/simple_scatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/animation/simple_scatter.py b/examples/animation/simple_scatter.py index ec82fae19f4f..1d18039dcf11 100644 --- a/examples/animation/simple_scatter.py +++ b/examples/animation/simple_scatter.py @@ -1,6 +1,6 @@ """ ============================= -Animated Scatter Saved as Gif +Animated scatter saved as GIF ============================= """ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy