0

This code

qplot(1:100, 1:100) + 
  theme_void() +
  theme(plot.background=element_rect(fill="green"))

produces a plot (shown below) that still has some space outside of the plotting area. I would like this space to be removed. The centers of the (1,1) and (100,100) points in the plot below should be exactly at the lower-left and upper-right corners, respectively.

Is there a way to achieve this?

(The reason I need this is that I am using this as lower layer for annotation_custom(). I am using the 1:100 x/y grid to overlay other plots, however this whitespace gives problems when positioning other elements, since the relative proportions are changed after resizing.)

too much space around points

2
  • 3
    ?scale_x_continuous(expand = c(0,0) ditto for y May 25, 2018 at 16:50
  • well yes and thanks, I guess I wasn't looking for the answer with the right wording. awesome!
    – mkln
    May 25, 2018 at 16:56

0

Browse other questions tagged or ask your own question.