D
D
Danil Samodurov2020-06-17 10:19:37
Python
Danil Samodurov, 2020-06-17 10:19:37

How to control plot window in matplotlib which is plotted in real time?

Hello. I've been able to plot in matplotlib in real time with data coming in all the time. To do this, I use the code below inside the loop.

plt.plot(x, y)
plt.draw()
plt.pause(0.0001)
plt.clf()

But here a problem arises. The graph window is constantly displayed on top of other windows when the print area is updated. In addition, if I need to use the interactive navigation of the chart window to view a part of the chart that was displayed earlier, then I will not succeed. Is there a way to solve this problem? Perhaps some other rendering library would be better?

PS How do I put a plot in a tkinter window?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dmshar, 2020-06-17
@dmshar

In fact, an animated graph in Python can be done in feng shui using the Animation class .
Many issues have been resolved there. Try it. If something doesn’t work out there specifically, ask a clarifying question, we will figure it out together.

M
MechanicZelenyy, 2020-06-17
@MechanicZelenyy

Here is an example of how to embed a chart in an application and update it: tyts .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question