Python realtime plotting

后端 未结 4 1617
感动是毒
感动是毒 2020-12-09 13:42

I acquire some data in two arrays: one for the time, and one for the value. When I reach 1000 points, I trigger a signal and plot these points (x=time, y=value).

I n

4条回答
  •  春和景丽
    2020-12-09 14:05

    Use a fixed size array and plot that using matplot.

     import collections
     array = collections.deque([None] * 1000, maxlen=1000)
    

    Whenver you append to the array it will remove the first element.

提交回复
热议问题