From 74a9b0f95d14d3b6bb540a648f31e9437d2740c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Wed, 2 Feb 2022 17:13:19 +0100 Subject: [PATCH] update plot --- ch01.jl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ch01.jl b/ch01.jl index 481b75b..fc3ffa8 100644 --- a/ch01.jl +++ b/ch01.jl @@ -4,7 +4,7 @@ # Code from section 1.2.1 -function f(n) +function sum_n(n) s = 0 for i in 1:n s += i @@ -12,7 +12,13 @@ function f(n) return s end -@time f(1_000_000_000) +@time sum_n(1_000_000_000) + +# Code from section 1.4 + +@time using Plots +@time plot(1:10) +@time plot(1:10) # Code allowing to reproduce the data frame presented in section 1.3 @@ -98,11 +104,13 @@ plot(map([:time, :size], select!(df_plot, Not(:c)) scatter(df_plot.problem, Matrix(select(df_plot, Not(:problem))); labels=permutedims(names(df_plot, Not(:problem))), - title=title, + ylabel=title, yaxis = col == :time ? :log : :none, xrotation=20, - markershape=[:circle :diamond :star5], - markercolor=[:skyblue :orange :gold], + markershape=[:rect :diamond :circle], + markersize=[4 5 5], + markercolor=[:lightgray :lightgray :gold], xtickfontsize=7, ytickfontsize=7, - legendfontsize=7, titlefontsize=8) + legendfontsize=7, ylabelfontsize=7) + hline!([1.0]; color="orange", labels="C") end...)