You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a minor gripe, but in scale_*_continuous(n.breaks = 20), the n.breaks only kicks in when breaks = waiver() (the default).
The ask here is to also have n.breaks apply when giving a custom function(x, n) {...} so that one can flexibly combine breaks functions with the desired number of breaks.
Many scales::breaks_*() function factories have n as an argument in the constructor, so it isn't a direct problem for this function family.
However, it'd be swell if this would work for user-defined functions too.
As an example, I'd like the following two plots to be identical:
library(ggplot2)
p<- ggplot(mpg, aes(displ, hwy)) +
geom_point()
p+ scale_y_continuous(
breaks=scales::breaks_extended(), # resulting function has `n` as argumentn.breaks=20
)
Also a weird false positive warning using a binned scale:
library(ggplot2)
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
scale_y_binned(breaks=scales::breaks_extended(20))
#> Warning in scale_y_binned(breaks = scales::breaks_extended(20)): Ignoring `n.breaks`. Use a breaks function that supports setting number of#> breaks.
This is a minor gripe, but in
scale_*_continuous(n.breaks = 20)
, then.breaks
only kicks in whenbreaks = waiver()
(the default).The ask here is to also have
n.breaks
apply when giving a customfunction(x, n) {...}
so that one can flexibly combine breaks functions with the desired number of breaks.Many
scales::breaks_*()
function factories haven
as an argument in the constructor, so it isn't a direct problem for this function family.However, it'd be swell if this would work for user-defined functions too.
As an example, I'd like the following two plots to be identical:
Created on 2024-07-03 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: