Bug Fix For "matplotlib eventplot not shows all the binary data for big number of events" - Draft PR #30053
+8
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
** DRAFT PULL REQUEST **
closes #20243
This PR is a fix to the bug from Issue 20243. The bug concerns events being missing in graphs outputted by eventplot, when there is insufficient space for all events, for example when linelengths=1 and there is small screen space, and over 500 events to plot.
The fix involves a simple check to whether the number of events exceeds 200, and if the snap kwargs has not been set explicitly by the eventplot caller, and if so, turns off snapping, sets 'antialiaseds' to True, and outputs a warning letting them know snapping has been turned off due to high number of events, but they can override by manually setting snapping to True. Below (Figure 1) is a screenshot showing how the fix should work.
Figure 1

I believe this is the appropriate fix for this issue, as Path Simplification does not appear to be the source of the bug, as shown below, where the code in Figure 2 was run, with a print statement in src/path_converters.h, after the initial if-statement in the PathSimplifier Class' vertex function, on the main branch, as shown in Figure 3. Despite the print statement, no prints were outputted into the terminal when running the code in Figure 2, as shown in the terminal output in Figure 4. This suggests that Path Simplification is not involved in the bug in #20243.
Figure 2

Figure 3

Figure 4
