How to get more than one background color on ggplot2 plot area?

Viewed 546

Is it possible to have more than one background color for the plot area (but not the panel area) on a ggplot2 graph? A hunch tells me that it might be possible to do that as some sort of background color for axes.

This is what my current chart looks like:

And this is what I would like to achieve:

[The final colours will certainly be different. I just used this example in its simplest form in order to ease the discussion]

I tried passing "fill" arguments to:

theme(axis.text.y = element_text(fill = "red"),

but it obviously failed as that argument is meant for element_rect.

1 Answers
Related