[R] ggplot2::coord_fixed() margin problem

Martin Møller Skarbiniks Pedersen tr@xp|@yer @end|ng |rom gm@||@com
Sun Dec 20 13:22:04 CET 2020


Hi,
  I posted this on the Google Group for ggplot2 but got no response.
https://groups.google.com/g/ggplot2/c/441srnt6RZU

So I hope someone can help me here instead?!

-

If I don't use the coord_fixed() then all the background is yellow as
expected.
But I need to coord_fixed() and then it adds a little white around my plot.
Is it possible to avoid the white and use coord_fixed() ?

Here is a "Minimal, Reproducible Example":

library(ggplot2)
g <-
  ggplot() +
  theme(
     plot.background = element_rect(fill = "yellow2"),
     panel.background = element_rect(fill = "yellow2"),
  )
g <- g + coord_fixed()
g

Regards
Martin M. S. Pedersen

	[[alternative HTML version deleted]]



More information about the R-help mailing list