6
y 축의 최소 한도가 고정되고 (예 : 0) 최대면은 (scales="free_y"
일 때와 같이) 패싯의 데이터에 의해 결정되는 ggplot2를 사용하여면 처리 된 플롯을 작성하고 싶습니다. 나는 다음과 같이 작동 할 것으로 기대,하지만 그런 행운되었습니다ggplot을 사용하여 패싯에서 파트가 고정되고 파트가없는 축 한계를 생성 하시겠습니까?
library(plyr)
library(ggplot2)
#Create the underlying data
l <- gl(2, 10, 20, labels=letters[1:2])
x <- rep(1:10, 2)
y <- c(runif(10), runif(10)*100)
df <- data.frame(l=l, x=x, y=y)
#Create a separate data frame to define axis limits
dfLim <- ddply(df, .(l), function(y) max(y$y))
names(dfLim)[2] <- "yMax"
dfLim$yMin <- 0
#Create a plot that works, but has totally free scales
p <- ggplot(df, aes(x=x, y=y)) + geom_point() + facet_wrap(~l, scales="free_y")
#Add y limits defined by the limits dataframe
p + ylim(dfLim$yMin, dfLim$yMax)
그것은이 오류 (length(lims) == 2 is not TRUE
)를 던졌습니다 내게 너무 놀라운 일이 아니다하지만이 전략을 생각할 수 없다는에 시작합니다 이 문제가 발생합니다.