0

I am new to Matplotlib and have spent much time trying to figure out how to update my simple Matplotlib plot after the first run through my code. After i generate the plot, my code stops after the plot.show(). How do i get my code past this point to reload new data from my list? Here's a summary of my code:

import matplotlib.pyplot as plt

# here i have code that generates new_data every 2 minutes

data-gathering code
new_data = [1,3,4,6,-4,2,11]

#here i display that data, but i cant get my code to get past the first display of the plot so it can generat new data and add it to the plot
    plt.plot(new_data, 'ro')
    plt.ylabel('my data results')
    plt.show()
3
  • 1
    See also scipy.org/Cookbook/Matplotlib/Animations Commented Jun 20, 2013 at 17:45
  • see also Commented Jun 20, 2013 at 18:03
  • You might also want to use plt.pause to make sure the gui event loop updates Commented Jun 20, 2013 at 20:37

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.