Makie.jl x and y axis through origin (0, 0)

I want to create plots with Makie that have the frame going through the origin. Examples are seen in https://docs.juliaplots.org/latest/generated/plotlyjs/#plotlyjs-ref34 docs, which directs you to

I am looking from :origin or :zerolines. Is this possible in Makie currently?

Not as an option of the axis, currently. But you can do

f, ax, s = scatter(randn(200, 2))
vlines!(ax, 0, color = :black)
hlines!(ax, 0, color = :black)
hidespines!(ax)
f

3 Likes

Nice! Good quick workaround.

Still missing ticks, tick values etc. But good workaround.

I really find this possibility essential when looking at something that is oscillation near 0, so my personal opinion is that it is something that should be implemented. Easy to say when I don’t plan on doing it myself of course, but my opinion nontheless.

Your examples didn’t have the ticks inside, you can do that as well by adding LineAxis explicitly, but maybe it can be added as an option to Axis as well. I’ll think about it

You are right, my bad.

Thank you so much for you time, and your efforts on Makie!