The problem with my Chaco-based code above was that I was using an OverlayPlotContainer (container
). Because of this, each plot (from create_line_plot
) was being drawn with its own axes rather than each plot being drawn on the same set of axes. The following works:
pd = ArrayPlotData()
plot = Plot(pd)
for ii, track in enumerate(tracks):
x = np.array(track['xw'])
y = np.array(track['yw'])
x_key = 'x'+str(ii)
y_key = 'y'+str(ii)
pd.set_data(x_key, x)
pd.set_data(y_key, y)
plot.plot((x_key, y_key), color='blue', origin='top left')