请考虑以下几点:
library(ggplot2)
library(grid)
ggplot(diamonds, aes(clarity, fill=cut)) +
geom_bar() +
theme(
plot.margin=unit(x=c(0,0,0,0),units="mm"),
legend.position="top",
plot.background=element_rect(fill="red")) +
guides(fill=guide_legend(title.position="top"))
该命令的输出如下所示:
在plot.margin=unit(x=c(0,0,0,0),units="mm")
的上下文中,图例上方有大量不合适的白色(红色)空间。有谁知道如何补救吗?
谢谢你的任何提示。
诚心诚意,乔
https://stackoverflow.com/questions/17073772
复制相似问题