• 主页
  • 在ggplot中去掉面板的边框?

在ggplot中去掉面板的边框?

我正在尝试删除这个数据的边界。下面是我当前的代码:

ggplot(data = GDP, aes(x=year, y=gdp_percap/1e3, fill=continent)) + 
geom_col() + 
 facet_wrap(~continent, ncol=2) + 
 ylab("GDP") + 
  theme_minimal() + 
  theme(legend.position = "none",
  panel.background = element_rect(fill=NA, color="gray50"),
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank(),
  panel.border = element_blank())
  strip.background = element_rect(fill=NA, color=NA) +
scale_y_continuous(expand = expand_scale(mult = c(0, 0.05)),
breaks = seq(0,200,100),limits=c(0,NA)) +
scale_x_continuous(expand = c(0,0),
breaks = seq(1950,2000,20))

GDP-data

?

?

转载请注明出处:http://www.jxbyjx.net/article/20230518/1469134.html