[edit: added unspecified named parameters passed to new()
in answer to comments for the answer]
Pretty much the same answer as in how can theme_classic be accessed in rpy2 from ggplot2? , and since I am it I'll add the note that problems in rpy2 that one want to be eventually solved should be reported to the issue tracker.
import rpy2.robjects.lib.ggplot2 as ggplot2
class ElementRect(ggplot2.Element):
_constructor = ggplot2.ggplot2.element_rect
@classmethod
def new(cls, **kwargs):
res = cls(cls._constructor(**kwargs))
return res
# Monkey patch ggplot2
ggplot2.element_rect = ElementRect.new