Is it possible to set the margin in ggplot to a fixed size?
I create many plots, and I want them to look the same.
Especially I want them to have the same left margin, with different labels.
But
P<-ggplot()+geom_bar(aes(c("short
label1","short label2"),runif(2)))+coord_flip()
creates a plot with another margin as
P<-ggplot()+geom_bar(aes(c("very very very very label1","short
label2"),runif(2)))+coord_flip()
In the standard plot system margins can be set with
par(mar=c(…….)), but this doesn’t work in ggplot2
I thought I could do it with plot.margin, but
p+theme(plot.margin= unit(c(0, 0, 0,3), "cm"))
doesn’t work,it adds an extra, external margin.
Does anyone know a solution?
Thanks
Frans                                     
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to