

p = plot(None, title="Custom Plot")[0]
p.addSeries(LinePlotSeries("My Series"))
proc_data = "/proc/calc"

create_dataset(proc_data , 'd')

def AfterReadout(record, scan):
    val = record.values[1] - record.values[0]
    p.getSeries(0).appendData(record.positions[0], val)    
    append_dataset(proc_data , val) 

lscan(inp, (out, sin), 0.0, 10.0, 1.0, latency = 0.1, after_read=AfterReadout)