0

I'm currently working on a project in Python and I need to plot some data in real time. I would like to make a GUI, thinking of using Tkinter library. I am using matplotlib for ploting.

The program has a for loop in main in which i call a function (lets call it A_func) that needs about 1 ms to 20 ms to preform (depends on curvefit problem). in every iteration of for loop (A_func calculation) i would like to "modify" my plot on GUI (I am ploting outputs of A_func)

In the code below i tried to simply present my code.

MAIN

# Some code

for ID in range(0, 3000):
    
    [output_data1, output_data2, output_data3] = A_func(ID, input_data1, input_data2, input_data3)
    
    # I would like to modify my plot (GUI)

    # example: plot(output_data1, output_data2)

I'm a bit lost right now because I'm new to Python so any kind of help would be greatly appreciated

  • Basically, what do you want to plot? –  May 26 '21 at 09:13
  • Currently i have a set of data the I read step by step and I make predictions about it, but in the fucture I'm gonna read live data (frekvency) and predict what is going to happen. I would like to plot the current data that i have and pridictions for every step (every iteration of loop) – user15854338 May 26 '21 at 09:25

1 Answers1

0

Matplotlib has some animation capabilities.

from matplotlib import pyplot as plt import matplotlib.animation as animation

Look for examples in the doc's ( and with google )