- Apparently,
order has to be numeric. However, this is not checked. Passing a character simply gives a warning ("NAs introduced by coercion").
- There is no example of
order nor of position.
I tried to add a secondary axis on the same side as the primary axis as follows:
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
scale_y_continuous(
sec.axis = sec_axis(trans = ~ 235.215 / ., name = "l/100 km",
guide = guide_axis(order = 2, position = "left")))
This leads to a warning: "Discarding guide on merge. Do you have more than one guide with the same position?" And the secondary axis is not drawn. So it seems that I did not fully understand the use of order and position yet...
orderhas to be numeric. However, this is not checked. Passing a character simply gives a warning ("NAs introduced by coercion").ordernor ofposition.I tried to add a secondary axis on the same side as the primary axis as follows:
This leads to a warning: "Discarding guide on merge. Do you have more than one guide with the same position?" And the secondary axis is not drawn. So it seems that I did not fully understand the use of
orderandpositionyet...