Learn R Programming

⚠️There's a newer version (1.1.3) of this package.Take me there.

cowplot – Streamlined plot theme and plot annotations for ggplot2

The cowplot package provides various features that help with creating publication-quality figures, such as a set of themes, functions to align plots and arrange them into complex compound figures, and functions that make it easy to annotate plots and or mix plots with images. The package was originally written for internal use in the Wilke lab, hence the name (Claus O. Wilke's plot package). It has also been used extensively in the book Fundamentals of Data Visualization.

Installation

The cowplot package is available on CRAN and can be installed via

install.packages("cowplot")

To install the latest development version of the package using the devtools package, enter the following in your R console:

devtools::install_github("wilkelab/cowplot")

Usage

To get a quick introduction to the main features of this package, read the introductory vignette. For a more in-depth discussion, read all vignettes and/or the reference documentation.

Copy Link

Version

Install

install.packages('cowplot')

Monthly Downloads

313,888

Version

1.0.0

License

GPL-2

Maintainer

Last Published

July 11th, 2019

Functions in cowplot (1.0.0)

add_sub

Add annotation underneath a plot
align_margin

Align multiple plots along a specified margin
draw_label

Draw a text label or mathematical expression.
draw_image

Draw an image
insert_xaxis_grob

draw_figure_label

Add a label to a figure
panel_border

Add/remove the panel border in a ggplot2 plot
get_plot_component

Get plot components
draw_grob

Draw a grob.
get_y_axis

Get plot axes
ggdraw

Set up a drawing layer on top of a ggplot
get_title

Get plot titles
background_grid

Add/modify/remove the background grid in a ggplot2 plot
theme_nothing

Create a completely empty theme
theme_minimal_grid

Minimalistic themes with grids
draw_line

Draw a line from connected points
cowplot

cowplot.
align_plots

Align multiple plots vertically and/or horizontally
as_grob

Convert a base plot or a ggplot2 plot into a grob
rectangle_key_glyph

Create customizable legend key glyphs
ggsave2

Cowplot reimplementation of ggsave().
gtable_remove_grobs

Remove named elements from gtable
draw_plot

Draw a (sub)plot.
png_null_device

Null devices
plot_grid

Arrange multiple plots into a grid
save_plot

Alternative to ggsave(), with better support for multi-figure plots.
as_gtable

Convert plot or other graphics object into a gtable
axis_canvas

Generates a canvas onto which one can draw axis-like objects.
get_legend

Retrieve the legend of a plot
get_panel

Retrieve the panel or part of a panel of a plot
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
gtable_squash_rows

Set the height of given rows to 0.
draw_plot_label

Add a label to a plot
draw_text

Draw multiple text-strings in one go.
stamp

Stamp plots with a label, such as good, bad, or ugly.
set_null_device

Sets the null graphics device