MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.4k stars 310 forks source link

`hlines`and `vlines` do not work well on log10 axis after the v0.20 update #3417

Closed egavazzi closed 11 months ago

egavazzi commented 11 months ago

After updating to v0.20, I noticed an issue with the hlines and the vlines when log10 scale is used. I could reproduce the issue on CairoMakie and GLMakie backends.

This is how it looks after the update (so on GLMakie v0.9.1 and CairoMakie v0.11.1) :arrow_down: v0 20 1

And this is before the update (so on GLMakie v0.8.12 and CairoMakie v0.10.12) :arrow_down: v0 19 12

The code used to produce the figures is the following.

using GLMakie
GLMakie.activate!()
# using CairoMakie
# CairoMakie.activate!()

f = Figure(size = (800, 600))
axv = Axis(f[1, 1]; title = "vlines, idendity scale")
vlines!(axv, 5)
axvlog = Axis(f[1, 2]; yscale = log10, title = "vlines, log10 scale")
vlines!(axvlog, 5)

axh = Axis(f[2, 1]; title = "hlines, idendity scale")
hlines!(axh, 5)
axhlog = Axis(f[2, 2]; xscale = log10, title = "hlines, log10 scale")
hlines!(axhlog, 5)
f
egavazzi commented 11 months ago

For the context (and because this might help in the debugging process). I noticed it in one of my plots where the vlines is actually displayed, but is too short: vlines_IeE_tooshort

I fixed it temporarily by setting the ymax attribute of the vlines to a high number.

vlines!(ax6, 534; ymax = 1e5, color = :white, linewidth = 3)

vlines_IeE_good