epezent / epezent/implot

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

Open
#558 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6.2k
Forks
693
PR merge metrics
No merged PRs in 30d

Description

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():
```C++
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](https://github.com/epezent/implot/assets/4819061/f76d5dfd-8024-4c62-9acb-a3605879494c)

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.