Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Animated scatter plot
#1
I try to get a animated scatter plot, in which a y value is plotted for every x, each second.

x = np.array(range(0,750))
y = np.array(np.random.rand(750))
for i in range(0,len(x)):
plt.scatter(x[i],y[i])
plt.axis([0,750,0,1])
plt.xlabel('x')
plt.ylabel('y')
plt.draw()
plt.pause(interval=0.1)


The axis should remain constant and previous plotted dots should hold. Can anyone help me with the standard form?
I've tried with matplotlib.animation, but I can't make it work. Right now it plots a new figure for every i
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked plt.scatter() errors asja2010 0 1,460 Oct-13-2022, 08:15 AM
Last Post: asja2010
  How to invert scatter plot axis Mark17 3 2,492 Sep-22-2021, 04:45 PM
Last Post: jefsummers
  How to plot intraday data of several days in one plot mistermister 3 2,891 Dec-15-2020, 07:43 PM
Last Post: deanhystad
  Group scatter plots Mekala 0 1,636 Jul-23-2020, 02:18 PM
Last Post: Mekala
  how to nest loop for 4*4 scatter plot kassamohammed 0 2,567 Jun-23-2020, 09:47 AM
Last Post: kassamohammed
  How to create Custom Buttons for 3D Scatter plots in Plotly? yourboyjoe 0 2,127 Jun-01-2020, 10:58 PM
Last Post: yourboyjoe
  colorbar for scatter shows no negatives values... gil 0 1,533 Apr-15-2020, 12:45 AM
Last Post: gil
  plotly.graph_objs - Scatter mode error sambanerjee 14 9,071 Mar-18-2020, 02:54 PM
Last Post: sambanerjee
  Scaled scatter modification yvrob 1 1,964 Nov-08-2019, 04:05 AM
Last Post: yvrob
  How to plot multiple scatter plots in seaborn vikola 2 6,469 Jul-14-2019, 10:30 AM
Last Post: vikola

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020