Open jariji opened 2 months ago
Why it switches to decimeter is because the default is to automatically switch to the best unit to represent the number range. Why it drops the second is not really clear to me... You could have a look at: https://github.com/MakieOrg/Makie.jl/blob/master/src/dim-converts/unitful-integration.jl And see where it goes wrong!
It's one of the base_unit() calls.
https://github.com/MakieOrg/Makie.jl/blob/4c4eaa1f3a7f7b3777a4b8ab38388a48c0eee6ce/src/dim-converts/unitful-integration.jl#L14-L16
It goes through these 3 in order where in the last one U = (m, s^-1)
, so that indexing just grabs m
It looks like most of this is for adjusting unit prefixes to the range of numbers given. E.g. changing 10000m .. 54000m
to 10km .. 54km
. I wonder if we should just drop those conversions.
It seems difficult to apply them to compound units - e.g. if you have "A * B / C", should A, B or C get a prefix? Some people may also supply specific prefixes on purpose because they are commonly used (e.g. g/cm^3). It also looks like this is not generic atm, i.e. we'd have to define valid prefixes for every unit and add special cases to avoid things like dft
(deci-feet).
Yeah keeping the user's units seems good.
Is there an option to do it at the top (or right) of the axes? I mean in the style that MATLAB does power of 10 representations (linear plot, scaled), then putting the units on top of the axis might help (see first image of https://tutorial45.com/matlab-plot-colors-and-styles/)
Agree, it would be both more familiar to many readers and less cluttered to show units once per axes – https://github.com/MakieOrg/Makie.jl/issues/3890.
The units are wrong.