How to save plot.bammdata plots

23 views
Skip to first unread message

Jamie T

unread,
Apr 26, 2022, 8:15:07 AM4/26/22
to bamm-project
I have a number of bammdata files (for many trees) that I'd like to show in the same panel e.g. using "ggarrange".  If I write "a = plot(event_data)" it plots it fine, but if I write "a" or "plot(a)" it just gives me the list without a plot.

How can I save the plot within R?

pasca...@gmail.com

unread,
Apr 26, 2022, 8:23:15 AM4/26/22
to bamm-project
Hi Jamie,

BAMMtools does not use ggplot for plotting, so what you are trying to do will not work. BAMMtools uses base R functions for plots. There are a number of ways to make multi-panel plots in R, using the layout() function for example or par(mfrow = c(nrow, ncol)), and there may even be additional R packages to streamline the process.

-Pascal

Jamie T

unread,
Apr 26, 2022, 8:56:08 AM4/26/22
to bamm-project
Thank you!
Reply all
Reply to author
Forward
0 new messages