View source: R/save_dye_screen_figs.R
save_stacked_plots | R Documentation |
Save dye screen plots with sensible dimensions and informative names.
save_stacked_plots(
.plot_list,
.figure_titles,
.plot_heights,
.default_width = 10,
.default_title_height = 0.5,
.use_common_legend = TRUE,
.common_legend_position = "top",
.override_fig_title = FALSE,
.override_save_width = FALSE,
.override_save_height = FALSE,
.override_plot_heights = FALSE,
save_fig = FALSE,
.save_path = "",
.save_suffix = "dye_screen_results",
.graphics_device = "pdf",
.manual_fig_title = "Manual figure title",
.manual_save_width = 10,
.manual_save_height = 10,
.manual_plot_heights = c(1, 1, 1),
...
)
.plot_list |
a list, containing plot objects created by ggplot2, in the order in which they will appear in the final figure. Typically, these are the output of the |
.figure_titles |
a names list of two elements, typically, but not necessarily, created using the
|
.plot_heights |
a numeric vector, determining the heights of each of the plots provided in .plot_list, in the final figure. |
.default_width |
a number, diving the width of the plots in the final figure. Defaults to 10. (unit: inches) |
.default_title_height |
a number, giving the number of inches to be added to the final figure to accomodate the plot title. |
.use_common_legend |
a boolean, determining whether a single legend should be displayed for the figure in cases where multiple plots in .plot_list share identical legends. Defaults to TRUE. |
.common_legend_position |
a string, giving the position within the figure for the common legend to appear. Defaults to "top". Is passed directly to 'legend' argument of the |
.override_fig_title |
a boolean, which, if TRUE, overrides the automatically-generated figure title with the string provided to the '.manual_fig_title' argument of this function. Defaults to FALSE. |
.override_save_width |
a boolean, which, if TRUE, overrides the automatically-generated width of the saved figure with the number provided to the'.manual_save_width' argument of this function. Defaults to FALSE. |
.override_save_height |
a boolean, which, if TRUE, overrides the automatically-generated height of the final saved figure, with the number provided to the'.manual_save_height' argument of this function. Defaults to FALSE. |
.override_plot_heights |
a boolean, which, if TRUE, overrides the hieghts given in the .plot_heights argument to this function. Is useful for overriding .plot_heights values which may be passed automatically from upstream functions to this one in longer workflows. Replaces with the numeric vector provided to the'.manual_plot_heights' argument of this function. Defaults to FALSE. |
save_fig |
a boolean which, if TRUE, results in the final plot generataed in this function being saved. |
.save_path |
a string which, if present, is appended to the beginning of the save path, determining the directory into which the output plot will be saved. No trailing '/' necessary; e.g. to save into the directory which can be accessed from the current working directory via "results/plots/<figure_name>", provide "results/plots" |
.save_suffix |
a string, giving a suffix to append to the name of the saved plot. e.g. "dye_screen_results" or "hits_by_channel". This string is the last element of the saved name to appear before the file extension, and the main way to differentiate different plots made for the same dye screen. |
.graphics_device |
a string, giving the extension of the graphics device used to save the final plot using the |
.manual_fig_title |
a string which, if .override_fig_title is set to TRUE, will appear as the title of the saved figure. |
.manual_save_width |
a number which, if .override_save_width is set to TRUE, will be passed directly to the 'width' argument of the |
.manual_save_height |
a number which, if .override_save_height is set to TRUE, will be passed directly to the 'height' argument of the |
.manual_plot_heights |
a numeric vector with the same lengths as .plot_list, which, if .override_plot_heights is set to TRUE, will be passed directly to ggarrange to set the heights of each plot within the figure. |
... |
additional arguments, which are not passed to anything within this function at this time. |
a saved plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.