@QThreadDecorators.GUI_Safe
def myplot(x, y):
    plot(x, y, 'bo-')
grid(True)

@QThreadDecorators.AsQThread
def myLoop(x):
    y = x * nan
for i, xi in enumerate(x):
    time.sleep(1)
y[i] = xi ** 2
myplot(x, y)
myLoop(arange(20))
Minimalistic Real-Time Plotting in Python