In [10]:
using Plots
default(size=(500,300))
In [11]:
p = scatter(rand(10),m=:+)
Out[11]:
In [12]:
for i in 1:10
push!(p, 1, rand())
end
p
Out[12]:
In [21]:
using Plots; immerse()
default(:size, (500,300));
In [28]:
# a couple things are happening here... we're pushing new
# data to our series, and redrawing with gui()
function add_to_plot(plt, rng)
for x in rng
push!(plt, x, [randn(), sin(x)])
# same as:
#push!(plt, 1, x, randn())
#push!(plt, 2, x, sin(x))
gui(); sleep(0.005)
end
end
rng = 0.2:0.01:2π
println("Testing $(n=length(rng)) points")
plt = plot([0,0.1], Any[randn(2),sin], t=[:sticks,:path], w=5)
t = @elapsed add_to_plot(plt, rng)
@printf "Average millis per update: %1.3f" 1000*t/n
In [33]:
plt = plot(rand(10,2))
Out[33]:
In [34]:
# append 3 points to the second series
append!(plt, 2,rand(3))
Out[34]:
In [35]:
# pushing a vector will add one to each series
for i in 1:100
push!(plt, rand(2))
end
plt
Out[35]:
In [ ]: