막대 그래프의 일부로 제거되었지만 극좌표의 바깥 쪽 반지를 제거하는 데 문제가 있지만 특정 방향으로 백분위 수를 보여주기 위해 극좌표를 작성하려고합니다. 극지 음모를 만드는 데 도움이됩니다.극좌표의 가장 바깥 고리 제거 (ggplot2)
library(ggplot2)
perc_df=data.frame(id=c(125,126,127,128,129,130),percentile=c(.50,.75,.99,.27,.12,.66))
cxc <- ggplot(perc_df, aes(x = id)) +
geom_bar(width = 1, aes(weight = percentile, fill = ..count..)) +
scale_y_continuous(limits = c(0,1),breaks=seq(0, 1, .25),expand=c(0,0)) +
scale_fill_gradient2(low = 'red', high = 'green',mid='yellow', limits=c(0,1),midpoint=.5,guide = "colourbar")
cxc + coord_polar(theta = 'x',start = 2.6)+ guides(fill=FALSE) +
theme(axis.title.x=element_blank(),axis.text.x=element_blank(),axis.ticks.x=element_blank(),axis.title.y=element_blank(),
axis.text.y=element_blank(),axis.ticks.y=element_blank(),plot.title = element_text(lineheight=.8, face="bold",hjust = 0.5),
panel.border = element_blank())
이 생산되는 것입니다 : 여기
는 재현 코드이 아주 가까이 있지만 우리가 하나의 백분위가의 마지막 원에되고 싶어 플롯의 외측 링을 갖기보다는 음모를 꾸미십시오.
편집 : 이미 답변을 포함 시키려고했지만 행운도 없습니다. Remove extra space and ring at the edge of a polar plot
는 당신이 더 구체적 일 수 있습니다 당신이 연결 한 대답에서 작동하지 않는 것은 무엇입니까? 이 질문은 저에게 중복 된 것 같습니다. – aosmith