Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Mar 25, 2020
1 parent 1c12ffe commit b8ea6bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
20 changes: 11 additions & 9 deletions src/basic_recipes/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
),
Expand Down Expand Up @@ -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]
Expand All @@ -409,7 +412,6 @@ function draw_titles(
)
end
end

if title !== nothing
# TODO give title own text attributes
push!(
Expand Down
2 changes: 1 addition & 1 deletion src/theming.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
3 changes: 1 addition & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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


Expand Down

0 comments on commit b8ea6bf

Please sign in to comment.