29
두 개의 열 범례가있는 플롯을 작성하려면 이라고 가정하는 다음 스크립트가 있습니다.ggplot에서 다중 열 범례 만들기
#!/usr/bin/Rscript
library(ggplot2)
library(plyr)
library(reshape2)
library(scales)
file <- "http://dpaste.com/1354089/plain/";
dat <-read.table(file,header=TRUE);
datm <- melt(dat)
# Plot them
ggplot(datm,aes(x = variable,y = value,fill = Term)) +
geom_bar(position = "fill") +
scale_y_continuous(labels = percent_format())+
theme(legend.direction ="vertical",legend.position = "bottom")+
guides(color=guide_legend(ncol=2))+ # this doesn't seem to work
ggsave(file="~/Desktop/test.pdf",width=11,height=11)
그러나 대신
어떻게 제대로 할 수 이 그림을 만들어?
1과 경고의주의를 기울여야한다. 어떤 제안, 경고를 해결하는 방법? – neversaint