I create a simple plot using GLMakie
:
GLMakie.scatter( range((-3e-9+1e-3)..(3e-9+1e-3),100), range(1..100,100) )
The result looks like this:
Looks like the x-axis is heavily quantized. The Plots
package handles the same command just fine:
Plots.scatter( range((-3e-9+1e-3)..(3e-9+1e-3),100), range(1..100,100) )
GLMakie
can also handle the same plot if the x range is centered on 0:
GLMakie.scatter( range((-5e-9)..(5e-9),100), range(1..100,100) )
Why is this happening? Does GLMakie
use a smaller float for speed? Can I do anything to avoid this?
Does GLMakie use a smaller float for speed?
Yes it does. OpenGL commonly uses 32 bit floats and Makie has been built with Float32 as a result. Right now you'd have normalize your data and adjust ticks manually to fix this. See https://makie.juliaplots.org/stable/examples/layoutables/axis/index.html#modifying_ticks
There are also a bunch of issues regarding this on github, for example https://github.com/JuliaPlots/Makie.jl/issues/1373.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With