adding two ggplot "finished" objects


is there a possibility to add two finished ggplot objects in the sense of overlaying them?

plt1 <- ggplot(mapping = aes(x = XDATA, y = YDATA)) + geom_line()
plt2 <- ggplot(mapping = aes(x = XDATA, y = YDATA2)) + geom_line()

plt3 <- plt1 + plt2

I know I could do plt3 <- plt1 + geom_line(aes(x = XDATA, y = YDATA2)) ) but I have some subroutines which return finished plot objects and I would be interested to add them afterwards?

Thanks a lot!!
Kind regards , Alex

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.