tiny-plot: sanity improvements in scatter plot tick labels#269
Merged
taimontgomery merged 4 commits intomasterfrom Dec 23, 2022
Merged
tiny-plot: sanity improvements in scatter plot tick labels#269taimontgomery merged 4 commits intomasterfrom
taimontgomery merged 4 commits intomasterfrom
Conversation
…ainly, this entails: 1. A flexible n in "every nth label" that scales with the axis range rather than being a constant value 2. The function that performs the initial calculation of major tick locations no longer places ticks outside of the plot's view limits as it had under certain conditions Additionally, the lowermost tick mark/label is no longer hidden by default, and the uppermost tick mark/label is no longer hidden if it is too close to the end of the axis. These measures were originally implemented when we were using exponent tick labels which are much wider, and aren't necessary with the shorter log2 labels.
…w for a mock scatter plot while saving each "frame". This is disabled by default because it takes a little while to run and produces many files
… which was added for testing purposes. It isn't a user-facing value so the default case should assume that it is not set.
Collaborator
|
Tested successfully with ram1 and Lib303 datasets. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The routine for placing scatter plot tick labels is now more robust when the plotted range is very small or very large. "Every other n" label placement now adjusts to the plot window rather than being a fixed n = 3. Labels are no longer suppressed at the origin; this was originally done when we were using exponent labels which are much wider. Labels at the upper end of the axis are placed more liberally. All in all, these changes produce tick labels with more comfortable density under a wider range of plot window sizes.
This is demonstrated in the animation below, which uses a rolling expanding window:

Closes #265