cowplot

CRAN - Package cowplot ggplot2のグラフをうまいこと学会や論文発表で使いやすいように整形したり並べたりできるパッケージ。

  • gridExtraよりも簡単に幅を揃えた複数の図表のgridを作成できる。
  • 図の「A, B, C, D」みたいなのも自動でも手動でも振ることができる。

公式vignettes Introduction to cowplot Arranging plots in a grid Changing the axis positions Plot annotations Shared legends

random dispersal: (cowplotパッケージ)研究用にスッキリ簡潔にggplotを描画 & 複数パネル化

scalesかなんかでgridの図の間の調節ができる模様

作成した図の保存 図を保存する際は「ggplot2::ggsave」でも大抵通るようだが、「cowplot::save_plot」の利用が推奨されている。 save_plot: Alternative to ggsave, with better support for multi-figure… in cowplot: Streamlined Plot Theme and Plot Annotations for ‘ggplot2’

base_width」と「base_height」の扱いに注意。あとはggsaveの引数が普通に使える。「dpi」とか。

save_plot(filename, plot, ncol = 1, nrow = 1, base_height = 4,
  base_aspect_ratio = 1.1, base_width = NULL, ..., cols = NULL,
  rows = NULL)