Streamlined Plot Theme and Plot Annotations for 'ggplot2'
Some helpful extensions and modifications to the 'ggplot2'
package. In particular, this package makes it easy to combine multiple
'ggplot2' plots into one and label them with letters, e.g. A, B, C, etc.,
as is often required for scientific publications. The package also provides
a streamlined and clean theme that is used in the Wilke lab, hence the
package name, which stands for Claus O. Wilke's plot package.
cowplot – An add-on to the ggplot2 plotting package
The cowplot package is meant to provide a publication-ready theme for ggplot2, one that requires a minimum amount of fiddling with sizes of axis labels, plot backgrounds, etc. It meets my personal needs; you may or may not like my style.
The package also fixes a couple of other annoyances that I encountered when trying to use ggplot2 for publication-ready figures, in particular with respect to combining multiple plots into one figure and labeling these plots. It turns out that the easiest way to fix these issues was to implement a general-purpose drawing canvas on top of ggplot2, so as a side effect of this work you can do pretty crazy effects with ggplot2 graphs.
This package is available on CRAN here and can be installed via
You can install the latest development version of this package using the devtools package. In your R console, simply enter:
Note that cowplot is in the early stages of development. While you may find it useful for certain graphing problems you encounter, it may have major problems or undergo substantial changes in the future. In particular, at this point I make no guarantees that the default theme will remain unchanged.
To get a quick introduction to the main features of this package, read the vignettes provided with the package on CRAN.
Functions in cowplot
|align_margin||Align multiple plots along a specified margin|
|draw_label||Draw a text label or mathematical expression.|
|draw_plot||Draw a (sub)plot.|
|get_legend||Retrieve the legend of a plot|
|gtable_squash_rows||Set the height of given rows to 0.|
|get_panel||Retrieve the panel of a plot|
|insert_xaxis_grob||Insert an axis-like grob on either side of a plot panel in a ggplot2 plot.|
|panel_border||Add/remove the panel border in a ggplot2 plot|
|plot_grid||Arrange multiple plots into a grid|
|draw_figure_label||Add a label to a figure|
|plot_to_gtable||Convert plot or other graphics object into a gtable|
|save_plot||Alternative to ggsave, with better support for multi-figure plots.|
|gtable_remove_grobs||Remove named elements from gtable|
|gtable_squash_cols||Set the width of given colums to 0.|
|theme_map||Create a theme for map plotting|
|theme_cowplot||Create the default cowplot theme|
|draw_plot_label||Add a label to a plot|
|draw_grob||Draw a grob.|
|draw_text||Draw multiple text-strings in one go.|
|theme_nothing||Create a completely empty theme|
|add_sub||Add annotation underneath a plot|
|background_grid||Add/modify/remove the background grid in a ggplot2 plot|
|draw_image||Draw an image|
|align_plots||Align multiple plots vertically and/or horizontally|
|axis_canvas||Generates a canvas onto which one can draw axis-like objects.|
|draw_line||Draw a line from connected points|
|ggdraw||Set up a drawing layer on top of a ggplot|
|ggsave||Cowplot reimplementation of ggsave.|
Vignettes of cowplot
Last month downloads
|Collate||'add_sub.R' 'axis_canvas.R' 'cowplot.R' 'draw.R' 'get_legend.R' 'get_panel.R' 'gtable.R' 'plot_grid.R' 'plot_to_gtable.R' 'save.R' 'setup.R' 'switch_axis.R' 'themes.R' 'utils_ggplot2.R'|
|Packaged||2019-01-07 23:10:34 UTC; wilke|
|Date/Publication||2019-01-08 05:50:03 UTC|
Include our badge in your README