相关疑难解决方法(0)

ggplot2,顶部和边缘的传奇

考虑以下:

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"))
Run Code Online (Sandbox Code Playgroud)

输出看起来像这样: ggplot2输出plot.margin=unit(x=c(0,0,0,0),units="mm")传说上方有一个不寻常的白色(红色)空间.有谁知道如何解决这个问题?

谢谢你的任何提示.

真诚的,约翰

graphics r ggplot2

23
推荐指数
3
解决办法
3万
查看次数

标签 统计

ggplot2 ×1

graphics ×1

r ×1