diff --git a/src/basic_recipes/axis.jl b/src/basic_recipes/axis.jl index 46e714996..fa0edf34e 100644 --- a/src/basic_recipes/axis.jl +++ b/src/basic_recipes/axis.jl @@ -36,14 +36,13 @@ $(ATTRIBUTES) showgrid = true, showticks = true, showtickmarks = true, - padding = 0.1, + padding = 0.0, ticks = Theme( - ranges_labels = (automatic, automatic), formatter = Formatters.plain, - gap = 3, + gap = 1, title_gap = 3, linewidth = (1, 1), @@ -56,9 +55,10 @@ $(ATTRIBUTES) align = ((:center, :top), (:right, :center)), font = lift(dim2, theme(scene, :font)), ), + tickmarks = Theme( - length = (3.0, 3.0), - linewidth = (1,1), + length = (1.0, 1.0), + linewidth = (1, 1), linecolor = ((:black, 0.4), (:black, 0.2)), linestyle = (nothing, nothing) ), @@ -383,9 +383,12 @@ function draw_titles( textcolor, textsize, rotation, align, font, title ) - tickspace_x = widths(text_bb( - last(first(yticks)), to_font(tickfont[2]), tick_size[2] - ))[1] + + tickspace_x = maximum(map(yticks) do tick + str = last(tick) + tick_bb = text_bb(str, to_font(tickfont[2]), tick_size[2]) + widths(tick_bb)[1] + end) tickspace_y = widths(text_bb( last(first(xticks)), to_font(tickfont[1]), tick_size[1] @@ -409,7 +412,6 @@ function draw_titles( ) end end - if title !== nothing # TODO give title own text attributes push!( diff --git a/src/theming.jl b/src/theming.jl index 755c50fa5..224604863 100644 --- a/src/theming.jl +++ b/src/theming.jl @@ -44,7 +44,7 @@ const minimal_default = Attributes( axis_type = automatic, camera = automatic, limits = automatic, - padding = Vec3f0(0.1), + padding = Vec3f0(0.05), raw = false ) diff --git a/test/runtests.jl b/test/runtests.jl index 10c1332e2..51ccf0b2f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,7 +4,6 @@ using Test using GLMakie # Download reference images from master -MakieGallery.current_ref_version[] = "master" const MINIMAL = get(ENV, "ABSTRACTPLOTTING_MINIMAL", "false") @@ -35,7 +34,7 @@ include("shorthands.jl") @test scene[Axis].ticks.title_gap[] == 3 scene[Axis].ticks.title_gap = 4 @test scene[Axis].ticks.title_gap[] == 4 - @test scene[Axis].tickmarks.length[] == (3, 3) + @test scene[Axis].tickmarks.length[] == (1, 1) end