我正在尝试为迄今为止 F1 车手赢得的冠军制作华夫饼图。图表很好,但它带有字母标签。我希望它从赢得最多冠军头衔到最少赢得冠军头衔开始。
我试过ordering和fct_relevel。但没有任何效果。下面是代码
ggplot(data = dfc, aes(fill=Champions, values=one)) +
geom_waffle(color = "cornsilk", size=0.25, n_rows=7)+
facet_wrap(~Champions, nrow = 3, strip.position = "bottom",labeller = label_wrap_gen(6))
这就是 我正在寻找的结果。
你可以在这里找到完整的代码
数据集看起来像
Season Champions Team one
1 a x 1
2 a x 1
3 b y 1
4 a x 1
5 c z 1