epezent / implot

Immediate Mode Plotting
MIT License
4.55k stars 503 forks source link

Use `%g` for the min/max sliders in the plot axis context menu #474

Closed sthenic closed 11 months ago

sthenic commented 1 year ago

Hi,

The custom ImGui::DragScalar widgets used to set the min/max axis limits from the right-click context menu use a simple %.3f format specifier. This works well for large scales but as soon as you're plotting data in the range below 1e-3 these widgets display 0.000 but otherwise work as expected. Another problem is that large values, e.g. 5.9e9, overflow the bounding box when they are rendered.

I changed the format specifier to %.3g for a practical compromise. Would that be all right to merge?