python - Real-time plot does not show up -



python - Real-time plot does not show up -

i plotting sensor info ftdi port using plt.plot() pyplot. unfortunately don't see line reason. when alter mark type: plt.plot(duration, temp, 'o') (or other point-like marktype) goes should. trying increment sleep time (reading problems plot , live-plotting other similar questions) not case.(i using ubuntu 14.04 if case reason)

#!/usr/bin/python import time import numpy np import matplotlib.pyplot plt print "we plotting sonar values" f = open('/dev/ttyusb0', 'r') plt.axis() plt.ion() plt.show() duration = 0; while true: print f.readline() temp = f.readline() temp = int(temp[1:]) plt.plot(duration, temp, 'o') duration+=1 plt.draw() time.sleep(0.1)

python matplotlib plot real-time

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -