axis_type::range_string conversion breaks small values #467
Unanswered
A-Little-Bit-Pseudo-Random
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
in axis_type::range_string(), the axis limits are converted to strings using std::to_string.
This internally uses sprintf("%f") which has a limit of 6 decimal places (not 6 significant digits), with no way to modify the precision it uses.
In our application, it's not uncommon to want to plot numbers in a small range (1.0e-07 or less). This results in the min and max ranges being equal (and maybe both zero) in the string, therefore nothing gets plotted. So I'm stuck having to detect that condition and prevent the user from setting the range manually.
It would be much better to use something like sprintf("%1.8g") which uses significant digits, rather than decimal places.
The only other places where I see std::to_string are for the run_empty_plot_command (harmless) font sizes (harmless), origin (possibly a problem), and size ratio (harmless).
Beta Was this translation helpful? Give feedback.
All reactions