ggplot2
에 범주 형 x 축 변수의 연속 Y 축 값을 플롯하려하고 플립하려고 시도하지만 y 축 값이 올바르지 않습니다. 전시.ggplot2 뒤집힌 Y 축 막대가 올바르게 설정되지 않음
이는 내 데이터가 설정됩니다
AIC.means AIC.lci AIC.uci
Sparse Dual Stream -4632.137 -4655.353 -4608.922
Heterogeneous Dual Stream A -4627.653 -4650.866 -4604.439
Heterogeneous Dual Stream B -4622.063 -4645.194 -4598.932
Dense Dual Stream -4616.507 -4639.633 -4593.381
Radical Storage -4615.934 -4639.052 -4592.817
Radical Sparse Comp. -4601.292 -4624.428 -4578.156
Radical Heterogeneous Comp. B -4600.650 -4623.785 -4577.515
Radical Dense Comp. -4589.490 -4612.632 -4566.348
Radical Heterogeneous Comp. A -4587.993 -4611.141 -4564.845
이 음모 내가 생산 줄거리에 대한 코드입니다. 아래와 같이
ggplot(AIC.plotdata, aes(x=row.names(AIC.plotdata), y=AIC.means)) +
geom_bar(aes(), stat="identity") +
scale_y_continuous(limits = c(-4700, -4500)) +
coord_flip()
는 I는 분 이하, 최고 상기 Y 축 제한을 설정. 따라서 y 축 레이블이 없으면 축 범위를 벗어나는 경우가있을 수 없습니다.
summary(AIC.plotdata$AIC.means)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-4632 -4622 -4616 -4610 -4601 -4588
이 내가 ggplot2
에서 얻으려고하지만, lattice
합니다 (AIC 값이 나는 아직 ggplot에 대해 알아낼 필요가 정렬 된 순서로 표시)를 사용하여 얻어진 것입니다.
나는 당신의 도움을 주셔서 감사합니다 것입니다!
geom_bar이 한계에 영점이 범위 A는이 바닥 – Nate
감사의 앵커 싶어! 데이터에 대한 흥미로운 차이가 -4700과 -4500 사이 인 경우이 제약 조건을 해결할 수있는 방법이 있습니까? 값은 모델 패널티를 나타내 므로 페널티가 낮을수록 모델이 좋으므로 부호를 뒤집는 것은 의미가 없습니다. –
'geom_bar' 용어에서'aes()'없이 시도해보십시오. 이것은 ggplot에 미학이 없다는 것을 알려줄 수 있습니다. 따라서 빈 차트가됩니다. –