View source: R/save_multi_panel_figure.R
save_multi_panel_figure | R Documentation |
A convenience function wrapping ggsave
from ggplot2 for easy saving of gtable
objects
constructed by multi_panel_figure
taking into account the
table's dimensions.
save_multi_panel_figure(figure, filename, dpi = 300, ...)
figure |
Object of classes |
filename |
Single |
dpi |
Single |
... |
Other arguments passed to |
Plot dimensions are determined using
figure_height
and figure_width
.
The Device type to use is guessed from the filename
extension.
Currently supported are "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff",
"png", "bmp", "svg" or "wmf" (windows only).
Johannes Graumann
Graumann, J., and Cotton, R.J. (2018). multipanelfigure: Simple Assembly of Multiple Plots and Images into a Compound Figure. Journal of Statistical Software 84. doi: 10.18637/jss.v084.c03
ggsave
, figure_width
,
figure_height
# Create the figure layout
(figure <- multi_panel_figure(
width = c(30,40,60),
height = c(40,60,60,60),
panel_label_type = "upper-roman"))
# Fill the top-left panel using a grob object directly
a_grob <- grid::linesGrob(arrow = grid::arrow())
figure %<>% fill_panel(a_grob)
## Not run:
# Save the figure
figure %>%
save_multi_panel_figure(
filename = paste0(
tempfile(),
".png"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.