From d035b6830746e69de312927a4f3b5d22b885f16d Mon Sep 17 00:00:00 2001 From: Olivier Cots Date: Tue, 18 Nov 2025 21:33:03 +0100 Subject: [PATCH] log scale --- docs/src/assets/toml/Manifest.toml | 24 ++++++++++++------- .../modules/PlotIterationsVsCpuTime.jl | 3 ++- .../docutils/modules/PlotTimeVsGridSize.jl | 22 +++++++++++++---- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/docs/src/assets/toml/Manifest.toml b/docs/src/assets/toml/Manifest.toml index e1b387bf..a99b70c0 100644 --- a/docs/src/assets/toml/Manifest.toml +++ b/docs/src/assets/toml/Manifest.toml @@ -149,7 +149,7 @@ version = "0.16.2" deps = ["BenchmarkTools", "CTBase", "CUDA", "DataFrames", "Dates", "DocStringExtensions", "InteractiveUtils", "Ipopt", "JSON", "JuMP", "MadNLPGPU", "MadNLPMumps", "NLPModelsIpopt", "OptimalControl", "OptimalControlProblems", "Pkg", "Plots", "Printf", "Sockets", "Tables"] path = "/Users/ocots/Research/logiciels/dev/control-toolbox/CTBenchmarks.jl" uuid = "db1dffaa-5ed3-4583-9a66-b5881c82ef11" -version = "0.3.0" +version = "0.3.1" [[deps.CTDirect]] deps = ["CTBase", "CTModels", "DocStringExtensions", "HSL", "MKL", "NLPModels", "SolverCore", "SparseArrays"] @@ -249,9 +249,9 @@ version = "0.19.2+0" [[deps.CUDSS]] deps = ["CEnum", "CUDA", "CUDSS_jll", "GPUToolbox", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "6356218f3c9a7509d1d830b7ec14e870faf65020" +git-tree-sha1 = "bff863cd922a9fad87b1173962a0d42068d55afb" uuid = "45b445bb-4962-46a0-9369-b4df9d0f772e" -version = "0.6.1" +version = "0.6.2" [[deps.CUDSS_jll]] deps = ["Artifacts", "CUDA_Runtime_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] @@ -611,15 +611,21 @@ version = "1.0.0" [[deps.GR]] deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Qt6Wayland_jll", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"] -git-tree-sha1 = "f52c27dd921390146624f3aab95f4e8614ad6531" +git-tree-sha1 = "f305bdb91e1f3fcc687944c97f2ede40585b1bd5" uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" -version = "0.73.18" +version = "0.73.19" + + [deps.GR.extensions] + GRIJuliaExt = "IJulia" + + [deps.GR.weakdeps] + IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" [[deps.GR_jll]] deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "4b0406b866ea9fdbaf1148bc9c0b887e59f9af68" +git-tree-sha1 = "a22d675409308f1bb4f3fb583599fcd28a0a7e4f" uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" -version = "0.73.18+0" +version = "0.73.19+0" [[deps.GettextRuntime_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll"] @@ -1411,9 +1417,9 @@ version = "1.5.0" [[deps.PrettyTables]] deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"] -git-tree-sha1 = "6b8e2f0bae3f678811678065c09571c1619da219" +git-tree-sha1 = "2542fd0b9476562d80b65d00968c9c5286d5917b" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "3.1.0" +version = "3.1.1" [[deps.Printf]] deps = ["Unicode"] diff --git a/docs/src/docutils/modules/PlotIterationsVsCpuTime.jl b/docs/src/docutils/modules/PlotIterationsVsCpuTime.jl index bd9fd565..05448958 100644 --- a/docs/src/docutils/modules/PlotIterationsVsCpuTime.jl +++ b/docs/src/docutils/modules/PlotIterationsVsCpuTime.jl @@ -88,7 +88,7 @@ function _plot_iterations_vs_cpu_time(problem::AbstractString, xlabel = "Iterations", ylabel = "CPU time (s)", title = "\nIterations vs CPU time — $problem", - legend = :topleft, + legend = :best, grid = true, size = (900, 600), left_margin = 5mm, @@ -97,6 +97,7 @@ function _plot_iterations_vs_cpu_time(problem::AbstractString, titlefont = title_font, xguidefont = label_font, yguidefont = label_font, + yscale = :log10, ) for (idx, c) in enumerate(combos) diff --git a/docs/src/docutils/modules/PlotTimeVsGridSize.jl b/docs/src/docutils/modules/PlotTimeVsGridSize.jl index b8b194bc..1fe90e3d 100644 --- a/docs/src/docutils/modules/PlotTimeVsGridSize.jl +++ b/docs/src/docutils/modules/PlotTimeVsGridSize.jl @@ -50,10 +50,20 @@ function _plot_time_vs_grid_size(problem::AbstractString, bench_id::AbstractStri min_N = minimum(df_successful.grid_size) max_N = maximum(df_successful.grid_size) - span_N = max_N - min_N - padding = span_N > 0 ? 0.05 * span_N : 1 - x_min = max(0, min_N - padding) - x_max = max_N + padding + if min_N > 0 && max_N > min_N + log_min = log10(min_N) + log_max = log10(max_N) + span_log = log_max - log_min + padding_log = 0.05 * span_log + x_min = 10^(log_min - padding_log) + x_max = 10^(log_max + padding_log) + else + span_N = max_N - min_N + padding = span_N > 0 ? 0.05 * span_N : 1 + x_min = max(0, min_N - padding) + x_max = max_N + padding + end + Ns = sort(unique(df_successful.grid_size)) plt = plot( xlabel = "Grid size N", @@ -62,7 +72,7 @@ function _plot_time_vs_grid_size(problem::AbstractString, bench_id::AbstractStri legend = :bottomright, grid = true, size = (900, 600), - xticks = sort(unique(df_successful.grid_size)), + xticks = (Ns, string.(Ns)), xlims = (x_min, x_max), left_margin = 5mm, bottom_margin = 5mm, @@ -70,6 +80,8 @@ function _plot_time_vs_grid_size(problem::AbstractString, bench_id::AbstractStri titlefont = title_font, xguidefont = label_font, yguidefont = label_font, + xscale = :log10, + yscale = :log10, ) for (idx, c) in enumerate(combos)