Closed
Description
testdat <- data.frame(x = runif(11),
y = seq(0,1,0.1))
# NOT OK
ggplot(data = testdat, aes(x = x, y = y)) +
geom_point() +
scale_y_continuous(sec.axis = sec_axis(trans = ~ .^0.5))
# OK
ggplot(data = testdat[testdat$y > 0, ], aes(x = x, y = y)) +
geom_point() +
scale_y_continuous(sec.axis = sec_axis(trans = ~ .^0.5))