Hello, new to Julia so I may have missed something here. I’m creating a line plot, setting the style as step, then adding points in a loop … to mimic the output of a simulation. When the points are added the style reverts to the normal. Latest packages in JuliaPro/Atom. Any suggestions?
Also, while I’m here, any suggestions on how to make this faster? It’s about 9 s to add the points, so about 100 ms an iteration, love it to be 10x faster!
# Initial plot, steps style
using Plots
gr()
x = 0:10
y = rand(11)
plt = plot(x, y, seriestype = :steppost,
legend=false)
xlims!((0,100))
ylims!((0,1))
display(plt)
# Add to plot, reverts to normal style
function AddToPlot()
for i = 11:100
push!(plt, 1, i*1.0, rand())
display(plt)
end
end
@time AddToPlot()