Tick direction in Makie

Is there a way to change the tick direction? The default is that ticks are outside the axes. I would like them to be inside, but I cannot seem to find anything about this in the documentation.

xtickalign=1

here, an example with both cases, Out and In.

https://lazarusa.github.io/BeautifulMakie/ScattersLines/Fig2Lines/

2 Likes

Thank you! I had mistakenly thought tickalign referred to rotation of the ticks somehow.

I should add a visual example in the docs.

2 Likes

That would be nice a nice addition. It’s also not clear whether xtickalign=1 means it will be outside or inside and what value explicitly makes it outside (I assume 0). And is there a middle (sticking both inside and outside the axis)?

It’s written here https://makie.juliaplots.org/stable/documentation/api_reference/#Axis, and yeah you could use 0.5 and it would be in and out

1 Like

I’m from the future, this thread is a top search result, and both of these links don’t work any more (c.f. XKCD:979, but not quite as dramatic :slightly_smiling_face:)

Anyway, here’s a mwe for “inner ticks with labels,”

using CairoMakie

fig = Figure()
ax = Axis(
    fig[1, 1], 
    limits = (-10, 10, -5, 5), 
    xticks = [-3, 0, 3], 
    xtickalign = 1.0,
    xticklabelpad = -25
)

save("inner_ticks.png", fig)

3 Likes

Thank you for updating this post. I’ve made your reply the new Solution.

Here is an updated link to the documentation for tick alignment.

xtickalign docs

https://docs.makie.org/stable/reference/blocks/axis/#xtickalign

Axis documentation (with other info about configuring an Axis)

https://docs.makie.org/stable/reference/blocks/axis/

2 Likes