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

Handling of grid = TRUE #78

Merged
merged 3 commits into from
Sep 8, 2023
Merged

Handling of grid = TRUE #78

merged 3 commits into from
Sep 8, 2023

Conversation

zeileis
Copy link
Collaborator

@zeileis zeileis commented Sep 8, 2023

If grid = TRUE is specified, then the new abline(... = pretty(extendrange(...)), ...) is used now instead of grid() - and not just for date/time classes (see #77).

Reason: Unlike grid(), the function pretty() is generic. Thus, it can adapt better to axes for variables of other classes.

Only exception: For axes in logs, we still resort to using grid() which is likely handled better there.

Potential downside: In all cases I tried, the pretty(extendrange(...)) approach yielded the same grid positions as grid(). But there may be situations when differences occur. However, in the examples I tried, I wasn't able to produce such a situation.

Copy link
Owner

@grantmcdermott grantmcdermott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Good catch on the log axes and I think this helps keep cleaner internals, in addition to the generic dispatch. All checks passing, so I'm happy to merge. Users should still be able to pass grid = grid() if they want to enforce the "old" behaviour anyway.

@grantmcdermott grantmcdermott merged commit 0907dca into main Sep 8, 2023
2 checks passed
@grantmcdermott grantmcdermott deleted the grid-true branch September 8, 2023 01:33
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

Successfully merging this pull request may close these issues.

2 participants