Combine Two ggplot2 Plots with Consistent Style, Geom, and Axis Expansion
combine_ggplot.Rd
This function overlays two ggplot2 plots of the same type (e.g., line, point, bar) into a single plot, preserving the original geoms used in each layer (e.g., lines and points together). It automatically extracts aesthetic mappings, axis expansions (including custom `expand` or limits), and theming from the first plot. It also combines legends using a `SourceGroup` that distinguishes both the type and origin of the data.
Usage
combine_ggplot(plot1, plot2, plot_names = c("Plot 1", "Plot 2"))