【发布时间】:2017-06-26 15:09:51
【问题描述】:
Dataset looks like this and is entitled rotterdam3
我正在尝试将其放入一个堆叠条中,其中只有一个垃圾箱,该垃圾箱是该党以他们赢得的投票份额的百分比堆叠在一起的。我现在的代码如下。我知道我的问题..它因为 Party 变量中有两件事,所以它不会把它放在一个变量中。我不确定如何改变这一点。我试图取出 x 参数,但 ggplot 不允许使用 geombar。
ggplot(rotterdamparty3, aes(Party, PercVote, fill=Variable)) +
geombar(stat="identity")
xlab("Party") +
ylab("Percent of vote share") +
ggtitle("Total Cote Share between VVD and PVV in Rotterdam") +
theme(axis.title.x=element_blank(),
scale_fill_manual(values=c("darkblue, "chocolate3"), labels=c("VVD", "PVV")) +
theme(text=element_text(size=14, vjust=1, family="Trebuchet MS")) +
theme(panel.background = element_rect(fill='gray95', colour='white'))
【问题讨论】:
-
我的数据集是什么样子的链接在我的问题顶部。谢谢大家!
标签: r ggplot2 rstudio geom-bar