【发布时间】:2019-11-10 12:15:54
【问题描述】:
我正在尝试使用 R 从 Tableau 中重现一个像这样的简单华夫饼图:
我不确定在waffle 包中是否可行,但是我非常感谢对两种情况的任何帮助:
- 有什么方法可以逐行填充华夫饼图(例如 Tableau 示例)不是按列?
- 是否可以在华夫饼图中添加标签百分比 (24%)?
到目前为止,这是我的尝试:
library(waffle)
# dummy sample
basedata <- c('User'=24, 'Not User'= 76)
# Waffle chart
waffle(
basedata,
rows = 10 ,
colors = c("#636363", "#fee8c8"),
xlab = "1 square == 1%"
) +
ggtitle("Some tilte") +
theme(
plot.title = element_text(hjust = 0.5, size = 27, face = "bold"),
legend.text = element_text(size = 15),
legend.position = "bottom"
)
【问题讨论】:
标签: r ggplot2 waffle-chart