In [1]:
%matplotlib notebook

In [2]:
import os, sys
sys.path.append(os.path.abspath('../../main/python'))

In [3]:
import time
import numpy as np
import thalesians.tsa.visual as visual

In [4]:
liveplot = visual.LivePlot()
liveplot.ax.plot([], label='mid')
liveplot.ax.plot([], [], '^', ms=12, c='green', label='buy')
liveplot.ax.plot([], [], 'v', ms=12, c='red', label='sell')
liveplot.ax.grid()
liveplot.ax.legend(loc='upper right')
liveplot.ax.set_xlabel('time')
liveplot.ax.set_ylabel('price')
liveplot.ax.set_title('prices')
for i in range(10):
    time.sleep(1)
    liveplot.append(i, np.random.random((3,))/10.)