【发布时间】:2020-06-09 04:22:27
【问题描述】:
我在这里使用 facet_wrap 得到了多个直方图,但不知何故,我在分类变量中仍有“NA”数据用于分面。然后,我将 NA 更改为 0,认为它不会再次出现在情节中。然而,0 是另一个值,例如 NA。
这是代码
ggplot(dftrai,aes(`12 Income`,fill=`13e Toilet type`,color=`13e Toilet type`))+
geom_histogram(alpha=(0.3))+#psition = identity as overlapping histogram
theme(legend.position = "top")+
scale_fill_manual(values=c("#999999", "#E69F00", "#56B4E9","#FA3910"))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9","#FA3910"))+
facet_wrap(~`13e Toilet type`,ncol = 3)
这是剧情结果 我想摆脱那里的'0'图表 ggplot
【问题讨论】:
-
见
help("droplevels")
标签: r ggplot2 facet-wrap