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
I've been testing out the new discrete secondary axis functionality in the DEV version.
Firstly, awesome work and a great advance!
I felt the discrete secondary axis labels and breaks arguments were working in unexpected ways in that:
default sec.axis discrete labels are numeric - should they be the actual labels instead?
palette moves the breaks in scale_*_discrete, but breaks does this in sec.axis - should the sec.axis operate in the same way as the discrete scale?
I'm not familiar with the internals. So there be valid reasons for this that I'm unaware of. Anyway, great work on this. It'll be a super useful feature. Sorry to bombard with issues. As always, feel free to close, if it is working the way you want it to
#palette moves the breaks in scale_*_discrete but breaks does this in sec.axis
ggplot(data, aes(x, y)) +
geom_point() +
scale_x_discrete(
palette= \(x) c(0.5, 1.5, 3.5),
sec.axis= dup_axis(
breaks= c(1.3, 3, 4)
)
) +
labs(title="palette moves the breaks in scale_*_discrete but breaks does in sec.axis")
The text was updated successfully, but these errors were encountered:
davidhodge931
changed the title
Discrete secondary axis labels and breaks arguments working in unexpected ways
Discrete secondary axis labels and breaks arguments work in unexpected ways
Sep 6, 2024
davidhodge931
changed the title
Discrete secondary axis labels and breaks arguments work in unexpected ways
Discrete secondary axis labels & breaks arguments work in unexpected ways
Sep 6, 2024
I guess the think to grok is that secondary discrete axes operate on the numeric equivalent of the discrete scale. Hanging onto the constraints of discrete scales makes secondary discrete axes clunky to use.
default sec.axis discrete labels are numeric - should they be the actual labels instead?
This would only makes sense if the secondary breaks positions match the primary ones, which isn't guaranteed. Besides that, we kind of assumed that people'd use secondary axes to display something else than the primary axis labels.
palette moves the breaks in scale_*_discrete, but breaks does this in sec.axis - should the sec.axis operate in the same way as the discrete scale?
I really don't like the idea of the primary and secondary axes having different palettes.
I suppose my point is from a user's perspective, you expect a discrete secondary axis to duplicate the discrete primary axis - and therefore the same arguments to work in the same way
teunbrand
added a commit
to teunbrand/ggplot2
that referenced
this issue
Oct 18, 2024
I've been testing out the new discrete secondary axis functionality in the DEV version.
Firstly, awesome work and a great advance!
I felt the discrete secondary axis labels and breaks arguments were working in unexpected ways in that:
I'm not familiar with the internals. So there be valid reasons for this that I'm unaware of. Anyway, great work on this. It'll be a super useful feature. Sorry to bombard with issues. As always, feel free to close, if it is working the way you want it to
Created on 2024-09-07 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: