我试图使用ggplot2在同一个窗口(大约12个)中绘制具有相同x轴的多个图形。我想使用适合该图的y轴范围,而不是对所有图使用固定的y轴。有关如何实现它的任何建议吗?
当前代码
tube_no <- c(1,2,1,2,1,2,1,2)
concentration <- c(1000,500,2,3,45,55,100,90)
dye <- c("blue","blue","red","red","white","white","green","green")
dat <- data.frame(tube_no,concentration,dye)
library(ggplot2)
ggplot(data = dat, aes(x = tube_no, y = concentration)) + geom_point() + facet_wrap(~dye)