Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #fig init
- fig2 = plt.figure()
- bx=fig2.add_subplot(111)
- fig2.canvas.draw()
- x = np.linspace(0,1, num=rows)
- y = np.linspace(0,1, num=cols)
- X,Y = np.meshgrid(x,y)
- h=bx.imshow(X,vmin=0,vmax=255,interpolation="None",cmap='gray')
- while True:
- try:
- # Recibe los datos
- data_out = rx(ext)
- end = timer()
- except:
- exc_type, exc_value, exc_traceback = sys.exc_info()
- print "*** print_tb:"
- traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
- print "*** print_exception:"
- traceback.print_exception(exc_type, exc_value, exc_traceback,limit=2, file=sys.stdout)
- break
- else:
- print "tiempo =" + str(end - start)
- start = timer()
- if(not data_out.size):
- break
- else:
- #cols check
- tam=TAM
- while True:
- if(data_out.size>=tam):
- data_out = data_out[:tam]
- break
- else:
- tam-=rows
- if(DEBUG):
- print "data:" + str(data_out.size)
- i += 1
- print i
- data_out.shape = (-1, rows)
- print data_out.shape
- #plot
- h.set_data(data_out)
- fig2.canvas.draw()
- fig2.canvas.flush_events()
- plt.pause(0.000000000001)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement