GLMakie vs Plots, not enogh precision for axis limits

I have ugly data with an ugly code, but I just used scatter in both places.

Plots gives this:
Screenshot from 2024-03-06 17-26-08

And, as you can see, the oscillations are in the double order.

GLMakie gives this:

Screenshot from 2024-03-06 17-24-54

If you zoom manually all the data behaves in the same way, however I can’t manually set it each time. Is there a way to say to GLMakie to not give up in setting axis limits?

P.S: I included a simple code:

using GLMakie

x = [1, 2]
y = Float64[1.00000001, 1.00000002]
f = Figure()
ax = Axis(f[1, 1])
scatter!(x, y)
display(f)

And GLMakie just gives up:
Screenshot from 2024-03-06 17-50-28

Found this:

You could try tightlimits!(ax) to force makie to zoom in around the points.

Regarding your example, I think the issue is that Makie converts everything to Float32 and so you lose the precision

Float32(1.00000001)
1.0f0

You can manually get around it by doing something like this:

x = [1, 2]
y = [1.00000001, 1.00000002]
yscaled = (y .- 1) .* 10^8

f = Figure()
ax = Axis(f[1, 1])
scatter!(x, yscaled)
ax.ytickformat=values->["$(round(value/10^8 + 1,digits=8))" for value in values]
display(f)

which gives this:

image

I can’t do that in my case. It was just a simple example. I need to rewrite everything in Plots, as nothing in Makie supports Float64 as ticks

My suggestion would be to make some data transformation before plotting. For example, subtract the mean value and then divide by the new mean value, to get a proper scaling for the comparison.

While I get that it’s annoying not to have the full Float64 range available right now for plotting in Makie, I also think that often plots that go to the tiny or huge float values are pretty hard to read. So for visualizations that are not one-offs where you quickly want to see some data, the scaling step is usually bearable. There is some work ongoing in Makie to improve the situation, but I don’t know when it will come to fruition.

Oh no, they are quite easy to read.

I found a solution here with the pythonplot package: