Loss of precision when plotting large floats in Makie

All numerical data in Makie is internally translated to Float32 before being plotted. For scatter plots this happens here for example (Point2f0 is 32-bit precision).

From what I understand, the rationale is that GPU-based backends need the data to be in Float32 for performance reason, but this does create some problems in a few cases. For example, converting date times to milliseconds is another scenario where this introduces some annoyances.

I imagine that ideally the conversion to Float32 should not happen in backend-independent code (as it currently does) and the GPU backends should be somehow find a way to use the whole Float32 range for the plot by shifting data back and forth, but have no idea how feasible this is.

1 Like