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 https://github.com/grantmcdermott/plot2/issues/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.
If
grid = TRUE
is specified, then the newabline(... = pretty(extendrange(...)), ...)
is used now instead ofgrid()
- and not just for date/time classes (see https://github.com/grantmcdermott/plot2/issues/77).Reason: Unlike
grid()
, the functionpretty()
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 asgrid()
. But there may be situations when differences occur. However, in the examples I tried, I wasn't able to produce such a situation.