wilkelab / cowplot

cowplot: Streamlined Plot Theme and Plot Annotations for ggplot2
https://wilkelab.org/cowplot/
701 stars 84 forks source link

Tip for plotting mgcViz object with cowplot #165

Closed tmeeha closed 4 years ago

tmeeha commented 4 years ago

Seems like the cowplot library has a hard time converting an mgcViz plot object to a grob for plotting because the object contains multiple classes, with a ggplot part and a data part. Therefore, when assigning an mgcViz object for plotting with cowplot, it is worth subsetting it first, as in: ggplot_object_for_cowplot <- name_of_mgcviz_object$ggObj.

clauswilke commented 4 years ago

Wrong location for this info. Consider asking a question on Stackoverflow and answering it yourself if nobody else does first.