3
我想要一个圆形条形图,像图所示:极地柱状图中,与最里面的圆空基于R
为了使这个我用在R中的以下代码:
require(ggplot2)
ggplot(PolarPlot,aes(x,y,
fill=x))+
geom_bar(width=1,stat="identity")+
coord_polar() + xlab("")+ylab("")+
theme(legend.position = "none" , axis.text.y = element_blank() ,
axis.ticks = element_blank()
有人可以告诉我需要做什么修改才能获得我想要的图吗?
的数据如下:
PolarPlot <- structure(list(x = structure(1:7, .Label = c("Class1", "Class2",
"Class3", "Class4", "Class5", "Class6", "Class7"), class = "factor"),
y = c(2L, 8L, 17L, 56L, 28L, 7L, 2L)), .Names = c("x", "y"),
class = "data.frame", row.names = c(NA, -7L))
看起来我们错过了您的数据。对于这种类型的问题,SO需要一个完全可重复的例子,以便我们可以帮助您。 –
我添加了数据。它只是一个简单的频率表。 – 204
谢谢。他们会说要以可复制的方式发布它(这意味着你可以将它读入R)。你可能想使用'dput(the_data)'。 –