gratia
gratia copied to clipboard
Add option for draw.gam() to return a list of plots instead of cowplot::plot_grid() output
Since draw.gam()
returns the output of cowplot::plot_grid()
, it can be difficult to modify the properties of individual panels. It can be convenient to users to have the option to modify those individual panels and then call plot_grid
themselves.
Maybe some kind of optional argument for whether to join the panels together?
draw.gam(..., assemble = TRUE) # returns plot_grid output as currently
draw.gam(..., assemble = FALSE) # returns the list of plots in `g`.
Would it be better to have draw.gam()
return inconsistently along the lines you suggest, or have a separate function assemble()
which would produce (the equivalent of) g
, and leave draw.gam()
as it is now, but use assemble()
internally to create g
?
Honestly, I'm unsure. A separate function maintains better {function name} -> {actual effect} mapping, but it's more memory load for users. Though, since you don't have an intro vignette yet, you have more flexibility to explicitly document the suggested workflow.
Ideally, we should just extend the +
operator to work on the output of plot_grid
... but that is a job for Claus Wilke, I think!
OK, thanks @ha0ye. I'll make an executive decision then :smile: