我正在创建以下情节ggplot2
:
- 请参阅“其他宗教”类别中出现的模式。它不是完全红色的。
- 我想这一定是因为我使用了该forcats::fct_other()
函数来创建类别。
- 如何去除图案?这是代码:
rel_wld %>%
select(year, ends_with("gen")) %>%
gather("religion", "value", -year) %>%
mutate(religion = fct_other(religion, keep = rels,
other_level = "Other Religions")) %>%
group_by(year) %>%
ggplot(aes(x = year, y = value, fill = religion)) +
geom_area(position = "fill") +
scale_fill_brewer(type = "qual", palette = 3) +
theme_light()