I'm trying to change the background colors of strips on top of facet grids/facet wraps in ggplot2 and also remove their bounding boxes (i.e. just show the labels). It seems that this require element_rect
which is not defined in rpy2 -- how can its constructor be defined? Or is there an alternative way of doing this without element_rect
? I tried:
my_plot += theme(**{'strip.background': element_blank()})
but it does not work, giving the error:
rpy2.rinterface.RRuntimeError: Error in (function (el, elname) :
Element panel.background must be a element_rect object.
also,
from rpy2.robjects.lib.ggplot2 import element_rect
fails with an import error. how can this be done?