Closed ekatko1 closed 1 year ago
Restored. But note that secondary axes do not work as you expect. They are pretty limited, because scales are not retrained and they just inherit the label, or you have to provide it explicitly.
@Enchufa2 Thanks for the quick fix! Yes, this is how they were withggforce
. Having secondary axes with units can be a future enhancement (or not).
With the
ggforce
package it was possible to use thesec.axis
option to specify a secondary axis. However, since the merge ofscale_units
into theunits
package, this is no longer possible. Thescale_units
function passes arguments to theggplot2::continous_scale
function which does not have asec.axis
option.Below is an example of how this could work, if implemented.
Currently, the last line returns:
Vignette on secondary axes in ggplot2 (e.g. using
ggplot2::scale_continous
): https://ggplot2.tidyverse.org/reference/sec_axis.html