我想保存一个情节,在情节区域周围没有任何空白。
我已尝试过这段代码,但仍然在yaxis的左边有空格,在xaxis下面。
library(ggplot2)
ggplot(data.frame(x=c(1,1,2,2),y=c(1,2,2,1)), aes(x, y)) +
geom_polygon(fill="grey75") +
geom_point(size=50,colour="yellow") +
theme(
legend.position = "none",
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.margin = unit(0,"null"),
plot.margin = rep(unit(0,"null"),4),
axis.ticks = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.ticks.length = unit(0,"null"),
axis.ticks.margin = unit(0,"null"))+
scale_x_continuous(expand=c(0,0)) +
scale_y_continuous(expand=c(0,0))][1]][1]