@time using SimplePlots
1.478263 seconds (3.18 M allocations: 162.722 MiB, 2.37% gc time)
function foo()
scatter(
rand(10), label="Scatter", color=4,
xlabel="x", markersize=6
)
ylabel!("y")
cur_x = 10 .^ (0:0.1:1)
cur_y = rand(0.25:0.05:0.75, length(cur_x))
plot!(cur_x, cur_y, label="Plot", color=3, title="Example")
hline!([1,3] ./ 4, color=2)
vline!(5, linewidth=4, alpha=0.4, linestyle=:dash)
plot!(xlim=(1,15))
ylims!(0,1)
xscale!(:log10)
end
@time foo()
1.638591 seconds (3.53 M allocations: 172.899 MiB, 9.20% gc time)
function bar()
yy = rand(10)
xx = slider(2:6, value=5, label="y")
SimplePlots.@gui for x in xx, t = "title" .* string.(1:4)
plot(x .* 1:10, yy, title=t)
end
end
@time bar()
1.318942 seconds (3.22 M allocations: 154.547 MiB, 3.16% gc time)
function baz()
yy = rand(10)
xx = slider(2:6, value=5, label="y")
SimplePlots.@manipulate for x in xx, t = "title" .* string.(1:4)
plot(x .* 1:10, yy, title=t)
end
end
@time baz()
0.021036 seconds (33.01 k allocations: 1.935 MiB)
using Dates
init_time = Dates.now()
yy = rand(10)
SimplePlots.@demo for x in 1:3, t in ["title 1", "title 2"]
plot(x .* 1:10, yy, title=t)
sleep(1/3)
end
run_time = ( ( Dates.now() - init_time ) / ( Millisecond(1) * 1000) ) - 2.0
println(" $(round(run_time,digits=8)) seconds")
1.804 seconds