Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data points that match the exact maximum value set for the axis are not displayed #558

Open
xieyiran opened this issue Mar 14, 2024 · 0 comments

Comments

@xieyiran
Copy link

I've noticed an issue where data points that match the exact maximum value set for the Y axis are not displayed in the plot. To address this, I've added a fixed offset to both the minimum and maximum values when calling ImPlot::SetupAxisLimits():

constexpr double Offset = 0.5; // in order to draw values that exactly equal to min or max
ImPlot::SetupAxisLimits(ImAxis_Y1, 0.0 - Offset, currentPlot.plotMaxValue + Offset, ImGuiCond_Always);

While that works most of the time(for small values like %), I've observed that the issue still persists sometimes, particularly when dealing with very high maximum values.
image

One way obvious is to switch from a fixed offset to a percentage-based offset instead. But I'm wondering whether this is the best solution.

Any advice would be appreciated!

Thanks,
Yiran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant