 # Xticks spacing changes when decorations are hidden

Helloo,

I made a MWE that emulates the kind of problem I have:

``````begin
f = Figure()
gl = GridLayout()
f.layout[1,1] = gl
for i in 1:2, j in 1:2
gl[i,j] = a  = Axis(f)
for (i,data) in enumerate([rand(100) for i in 1:(j == 2 ? 3 : 5)])
boxplot!(a, fill(i,100), data)
end
if j == 2
hideydecorations!(a, grid = false)
end
end
colsize!(gl, 1, Relative(5/8))
Label(f[1,0], "A common y label", rotation = pi/2, tellheight = false)
Label(f[2,1:2], "A common x label", tellwidth = false)
f
end
``````

To obtain

I know it may sound as a silly detail, but because I hide the y-decorations of the second column in the GL, the spacing between the xticks is not the same (if you use a ruler).
I’d like to know if there’s a way to set the relative colsize wrt the content of the axes only?

EDIT: Actually, the x-spines of the axes are correctly 5/8-3/8. The problem is more that the width of the boxes are not the same and thus the space between ticks neither.

Many thanks

Okay I found on my own. The difference between upper and lower xlims are not integers when auto-determined. Setting to 0.5 and 5+0.5 or 3+0.5 ensures they add to 8.

Here’s a working solution if someone’s ever interested:

``````begin
f = Figure()
gl = GridLayout()
f.layout[1,1] = gl
for i in 1:2, j in 1:2
gl[i,j] = a  = Axis(f)
n = (j == 2 ? 3 : 5)
for (i,data) in enumerate([rand(100) for i in 1:n])
boxplot!(a, fill(i,100), data)
end
if j == 2
hideydecorations!(a, grid = false)
end
xlims!(a, low = 0.5, high = n+0.5)
a.xticks = 1:n
end
colsize!(gl, 1, Relative(5/8))
colsize!(gl, 2, Relative(3/8))
Label(f[1,0], "A common y label", rotation = pi/2, tellheight = false)
Label(f[2,1:2], "A common x label", tellwidth = false)
f
end
``````

The reason is that the automatic gaps are given in fractions of the data limits, and 10% of the left plot x range is more than 10% of the right.