Large Numbers Make Lines Disappear in Makie

The following code:

using CairoMakie
xs = [1,2,3,4]
ys = [1,1,1e15,1]
fig = Figure()
ax1 = Axis(fig[1,1], limits=(nothing, nothing))
ax2 = Axis(fig[1,2], limits=(nothing, (0,2)))
lines!(ax1, xs, ys)
lines!(ax2, xs, ys)
fig

produces this graph:

Why is the line segment from (1,1) to (2,1) not displayed in the right-hand graph (which had the y limits set)? If I change 1e15 to NaN, the line is displayed, but I don’t want to do something hacky like setting all numbers above a certain threshold to NaN.

1 Like

Which version of Makie are you using (see ]st -m Makie CairoMakie)?

I see this on master:

2 Likes

It turns out I am using an old version of Makie, which is almost certainly the issue:

(@v1.9) pkg> st -m Makie CairoMakie
Status `~/.julia/environments/v1.9/Manifest.toml`
⌅ [13f3f980] CairoMakie v0.10.12
⌅ [ee78f7c6] Makie v0.19.12
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`

I’ll update, thanks for the help!