I would like to plot logit transformed data (originally percentages) in a comprehensible manner, i.e., in a plot with a logistic transformed y-axis.
library(tidyverse)
set.seed(123)
# Logit transformation function
logit <- function(x){
x <- x/100
log(x/(1-x))
}
# Create sample data
df <- data.frame(x = seq(1,10,1),
y = runif(10, 0, 10)) %>%
mutate(y = logit(y))
# Plot
ggplot(df, aes(x,y)) +
geom_point()
I noticed that the scale_y_continuous function has a trans argument, which should be able to do the job. However, a logit function is built-in, but its opposite the logistic isn't.
How can I plot logit transformed data normally (i.e., with a logistic transformed y-axis)?


