2012-08-24 2 views
4

코드에서 극좌표 그림을 그릴 데이터를 읽습니다. "0/360"이 맨 위에 있습니다. 어떻게 그것을 오른손으로 90도 회전시킬 수 있습니까?R의 ggplot2에서 "제로"oritentation을 설정하는 방법은 무엇입니까?

ggplot(polar, aes(x=angle, y=distance)) + coord_polar(start=0) + geom_point() + 
    scale_x_continuous(breaks=seq(0, 360, by=30), expand=c(0,0), lim=c(0, 360))+ 
    scale_area() 

전체 과정 및 결과의 그래픽은 여기에 설명된다 : http://keveting.blogspot.tw/2012/08/r-ggplot2-code.html

coord_polar 대한 설명서 :

시작 : 라디안 방향 12시 오프셋 : 1 방향으로;

-1, 시계 반대 방향으로는 그래서

ggplot(polar, aes(x=angle, y=distance)) + 
    coord_polar(***start = 90, direction = -1***) + 
    geom_point() + scale_x_continuous(breaks=seq(0, 360, by=30), expand=c(0,0), 
    lim=c(0, 360)) + scale_area() 

을 시도하지만 여전히 90도 오른쪽으로 플롯에게 내가 원하는 방식으로 회전하지 않습니다.

답변

8

나는이 당신을 위해 무엇을 찾고있는 생각 :

ggplot(polar, aes(x=angle, y=distance)) + 
    coord_polar(start = 1.57, direction=1) + geom_point() + 
    scale_x_continuous(breaks=seq(0, 360, by=30), expand=c(0,0), lim=c(0, 360)) + 
    scale_area() 
coord_polar 문서에 대한 링크가 말한대로

enter image description here

에서, start라디안 (되지도) 및 오프셋 (offset)입니다 시계 방향으로 돌리려고합니다 (그래서 direction=1).

관련 문제