Closed
Description
Applying any transformation using coord_trans()
modifies what the argument position
does in scale_
:
(notice that only the title of the axis is sent to the top and no longer the labels when coord_trans()
is used)
library(ggplot2)
packageVersion("ggplot2") ## note: current devel does also behave in the same way
#> [1] '3.3.5'
ggplot(data = iris) +
geom_point(aes(y = Sepal.Length, x = Species)) +
scale_x_discrete(position = "top")
ggplot(data = iris) +
geom_point(aes(y = Sepal.Length, x = Species)) +
scale_x_discrete(position = "top") +
coord_trans(y = "identity")
Created on 2021-07-08 by the reprex package (v2.0.0)
The same goes for the left/right positions.