View source: R/convert_plots.R
| convert_plots | R Documentation | 
Takes a plot or just of plots and converts to various formats.
convert_plots(
  plot_list,
  return_as = c("ggplot", "ggbio", "patchwork", "Tracks", NULL),
  x_limits = NULL,
  tag_levels = letters,
  params_list = NULL,
  verbose = TRUE
)
| plot_list | A plot, or a list of plots belonging to one of the following classes: 
 | 
| return_as | Plot class to convert  
 | 
| x_limits | x-axis limits to be applied to all plots (useful when trying to keep a common coordinate system). | 
| tag_levels | A character vector defining the enumeration format to use
at each level. Possible values are  | 
| params_list | A list of parameters to pass to tracks. | 
| verbose | Print messages. | 
#### Create example plot_list ####
gg <- ggplot2::ggplot(mtcars, ggplot2::aes(mpg, cyl)) + ggplot2::geom_point()
plot_list <- lapply(1:3, function(x) gg)
##### As ggplot #####
return_out1 <- convert_plots(plot_list = plot_list, return_as = "ggplot")
##### As ggbio #####
return_out2 <- convert_plots(plot_list = plot_list, return_as = "ggbio")
##### As patchwork #####
return_out3 <- convert_plots(plot_list = plot_list, return_as = "patchwork")
##### As Tracks #####
return_out4 <- convert_plots(plot_list = plot_list, return_as = "Tracks")
##### From Tracks #####
return_out5 <- echoannot::convert_plots(plot_list = return_out4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.