From 865c79752137a4963186f0dc188c8f4db6e97612 Mon Sep 17 00:00:00 2001 From: Viktor Petukhov Date: Fri, 13 Sep 2024 06:03:49 -0700 Subject: [PATCH 1/2] Fixed segmentation convergence plot size --- src/reporting/plots.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reporting/plots.jl b/src/reporting/plots.jl index a88eb0b..df3fc35 100644 --- a/src/reporting/plots.jl +++ b/src/reporting/plots.jl @@ -134,7 +134,8 @@ end function plot_num_of_cells_per_iterarion( n_comps_dict::Vector{Dict{Int64, Int64}}; legend_position::Symbol=:lt, - inset_bbox::Tuple{Int, Int, Int, Int}=(370, 550, 180, 330) + figsize=(500, 350), inset_bbox::Tuple{Int, Int, Int, Int}=(300, 480, 150, 310), + legend_titlesize::Int=16, legend_labelsize::Int=14 ) (length(n_comps_dict) > 0) || error("No data about #components per iteration was stored") @@ -144,7 +145,7 @@ function plot_num_of_cells_per_iterarion( n_components_per_iter = n_components_per_iter[sortperm(labels),:] labels = sort(labels) - fig = MK.Figure(size=(300, 200)); + fig = MK.Figure(size=figsize); axis_args = ( xticksvisible=false, yticksvisible=false, xticklabelsize=14, yticklabelsize=14, xlabel="Iteration", ylabel="Num. cells", xlabelpadding=0, ylabelpadding=0 @@ -154,7 +155,7 @@ function plot_num_of_cells_per_iterarion( for i in 1:size(n_components_per_iter, 1) MK.lines!(n_components_per_iter[i,:], label="$(labels[i])", color=ColorSchemes.Dark2_8[mod(i - 1, 8) + 1]) end - MK.axislegend("Min #molecules"; position=legend_position, nbanks = 2, titlesize=16, labelsize=14) + MK.axislegend("Min #molecules"; position=legend_position, nbanks = 2, titlesize=legend_titlesize, labelsize=legend_labelsize) MK.xlims!(MK.current_axis(), 0, size(n_components_per_iter, 2)) MK.ylims!(MK.current_axis(), 0, maximum(n_components_per_iter)) From 4d3fc4e50053ae06dc133e42606b216ada1ce45a Mon Sep 17 00:00:00 2001 From: Viktor Petukhov Date: Fri, 13 Sep 2024 06:04:00 -0700 Subject: [PATCH 2/2] Small test fix --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index bd8eed0..36ae02f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -241,7 +241,7 @@ end polygons = BPR.boundary_polygons_auto(pos_data, df_spatial.cell; estimate_per_z=true)[2] @test length(polygons) == (n_stacks + 1) @test "2d" in keys(polygons) - @show all("$(Float64(v))" in keys(polygons) for v in unique(z_vals)) + @test all("$(Float64(v))" in keys(polygons) for v in unique(z_vals)) n_stacks = 50 max_slices = 10