Commit 0c96577f authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

proper time axis

parent 1e6e497f
......@@ -52,20 +52,23 @@ function makegui(P, plottingframerate = 10, guiframerate = 10)
Node(:div, tankg, id="tanks", attributes=tankattr)
glnv = (0:maxplotlength)*P.h
w2, graphic2 = @construct for
plotdummy in checkbox(false, label="This button does nothing")
if length([1])>maxplotlength
start = length([1])-maxplotlength
dataln = length([1])
if dataln>maxplotlength
start = dataln-maxplotlength
p = plot(layout=(2,1), size=(700, 600))
plot!(p[1],[1][start:end], label="y", ylim = boundsupper)
plot!(p[1],[2][start:end], label="r")
plot!(p[2],[3][start:end], label="P", ylim = boundslower)
plot!(p[2],[4][start:end], label="I")
plot!(p[2],[5][start:end], label="D")
plot!(p[2],[6][start:end], label="Tot", color=:black)
lnv = glnv[1:min(dataln, maxplotlength+1)]
p = plot(layout=(2,1), size=(700, 600), xlabel = "seconds")
plot!(p[1], lnv,[1][start:end], label="y", ylim = boundsupper)
plot!(p[1], lnv,[2][start:end], label="r")
plot!(p[2], lnv,[3][start:end], label="P", ylim = boundslower)
plot!(p[2], lnv,[4][start:end], label="I")
plot!(p[2], lnv,[5][start:end], label="D")
plot!(p[2], lnv,[6][start:end], label="Tot", color=:black)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment