2014-06-14 3 views
-1

ggplot을 사용하여 내 데이터의 밀도 플롯을 만들었습니다. 그러나 2.0까지 X 값에 대한 플롯을 얻고 싶습니다. 어떻게이 restiriction 내 코드에 넣을 수 있습니까? 여기ggplot을 사용하여 플로팅을 위해 x 축의 상한선을 설정하는 방법은 무엇입니까?

내 코드와 줄거리는 다음과 같습니다

ggplot()+geom_density(aes(data=Ge,x=GeN[,1]),color='red') 

enter image description here

+0

'Ge'와'GeN' 무엇입니까? 이것은'ggplot'을 사용하는 방법이 아닙니다. GeN의 첫 번째 열에 x 값이 있고 열의 이름이 X1이라고 가정하면 'ggplot (GeN) + geom_density (aes (x = X1), color = "red") + xlim (0,2)' – jlhoward

답변

1
ggplot(iris, aes(x = Petal.Length)) + geom_density() 

enter image description here

ggplot(iris, aes(x = Petal.Length)) + geom_density() + xlim(0, 2) 

enter image description here

관련 문제