答案 0 :(得分:4)
您可以使用waffle
package。
library(waffle)
parts <- c('TRUE' = 3, 'FALSE' = 77)
p <- waffle(parts, rows = 8, colors = c("black", "grey70"))
p
class(p)
#[1] "gg" "ggplot"
这就是你如何组合两个图表,如上图
iron(
waffle(
c('TRUE' = 3, 'FALSE' = 77),
colors = c("black", "grey70"),
size = 0.5,
pad = 20,
legend_pos = "none"
),
waffle(
c('TRUE' = 2, 'FALSE' = 278),
colors = c("black", "grey70"),
size = 0.5,
legend_pos = "bottom"
)
)