1
ggplot을 사용하여 플롯 패널에 대한 결과를 보여줍니다. 지금은 이제 다시 제출 내 수치를 리메이크하고,해야 할 것을, 그러나ggplot facet_grid가 이제 왼쪽 스트립과 눈금 표시를 전환합니다.
: 내가 처음 내 인물을 만들 때 몇 개월 전, (그리고 ggplot의 최신 업그레이드 전에) 나는 이것을 할 수 있었다 내가 ggplot의 최신 버전으로 업데이트 한 것으로,이 동일한 코드를 생성 할 것입니다 :
참고로, 이것이 내가
#################### Set ggplot theme
themebar = theme(axis.text.x = element_text(face="bold", color="black", size=rel(1), angle=0),
axis.title.x = element_text(size = rel(1.1), angle = 0, face="bold"),
axis.text.y = element_text(face="bold", color="black", size=rel(1), angle=0),
axis.title.y = element_text(size = rel(1.1), angle = 90, face="bold"),
panel.border = element_rect(linetype = "solid", colour = "black", fill=NA),
legend.text = element_text(size = rel(0.7), face = "bold", lineheight=0.8),
legend.position = "bottom",
legend.box = "vertical",
legend.background = element_rect(fill=NA, size=0.25, linetype="solid", colour ="black"),
legend.title = element_blank(),
panel.grid.major = element_line(colour="gray", linetype = "dotted"),
panel.background = element_rect(fill = NA),
strip.background = element_rect(fill = NA),
strip.text = element_text(size=rel(1), face="bold")) # , strip.text = element_blank()
## labeller
alt_sites = c(`Kolkata` = "A", `Delhi` = "B", `Dong Thap` = "C", `Kibera` = "D", `Lwak` = "E")
ggplot(dat_2ceac_main, aes(x=wtpdol, y=prob, group=Intervention, colour=factor(Intervention))) + #
geom_line(size=1) +
geom_vline(aes(xintercept = 0), size=0.75, linetype=c("dotted"), show.legend=F) +
geom_vline(aes(xintercept = vce), data=threshold, linetype=c("dashed"), show.legend=F) +
geom_vline(aes(xintercept = ce), data=threshold, linetype=c("dotdash"), show.legend=F) +
facet_grid(site~., switch="y", labeller=labeller(site=as_labeller(alt_sites))) +
themebar + theme(strip.text.y = element_text(angle = 180, vjust=1), strip.switch.pad.grid=) +
scale_colour_manual(values=Set0, labels=c("No intervention", "Routine")) + # scale_colour_hue(c=120,l=45) +
scale_x_continuous(limits=c(0, 20000), labels=comma) +
scale_y_continuous(limits=c(0, 1)) +
guides(colour = guide_legend(nrow = 1, byrow=F)) + # title = "Intervention", title.position = "top",
ylab("Probability Cost-Effective") +
xlab("Willingness-to-pay per \ndisability-adjusted life-year averted, I$")
을 사용하고있는 코드는
그것은했다. 고마워, 너는 나에게 많은 시간을 절약 해 줬어. –