更改饼图上的数据位置

时间:2016-05-10 01:24:48

标签: r pie-chart

使用以下代码,我得到饼图。 "星期一"从饼图的中间开始。我想得到" Mon"在饼图的顶部。有没有办法开始"周一"从顶部(周四的地方)和周二(周三的地方)等。

B <- c(2, 4, 5, 7, 12, 14, 16)
pie(B, main="My Piechart", col=rainbow(length(B)),
labels=c("Mon","Tue","Wed","Thu","Fri","Sat","Sun"))

1 个答案:

答案 0 :(得分:0)

您可以将饼图设置为顺时针。

pie(B, main="My Piechart", col=rainbow(length(B)),
   labels=c("Mon","Tue","Wed","Thu","Fri","Sat","Sun"), clockwise = T)

enter image description here