Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


⚠️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:

remotes::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

394,645

Version

1.1.1

License

GPL-2

Maintainer

Claus O Wilke

Last Published

December 30th, 2020

Functions in cowplot (1.1.1)

align_plots

Align multiple plots vertically and/or horizontally
axis_canvas

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

Add a label to a figure
align_margin

Align multiple plots along a specified margin
as_gtable

Convert plot or other graphics object into a gtable
background_grid

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

Add annotation underneath a plot
as_grob

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

Draw a grob.
cowplot

Streamlined Plot Theme and Plot Annotations for 'ggplot2'
draw_plot_label

Add a label to a plot
draw_label

Draw a text label or mathematical expression.
draw_image

Draw an image
get_plot_component

Get plot components
get_title

Get plot titles
plot_grid

Arrange multiple plots into a grid
png_null_device

Null devices
get_legend

Retrieve the legend of a plot
get_y_axis

Get plot axes
ggdraw

Set up a drawing layer on top of a ggplot
get_panel

Retrieve the panel or part of a panel of a plot
gtable_squash_cols

Set the width of given columns to 0.
draw_text

Draw multiple text-strings in one go.
gtable_squash_rows

Set the height of given rows to 0.
ggsave2

Cowplot reimplementation of ggsave().
draw_line

Draw a line from connected points
set_null_device

Sets the null graphics device
gtable_remove_grobs

Remove named elements from gtable
stamp

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

Draw a (sub)plot.
theme_map

Create a theme for map plotting
theme_cowplot

Create the default cowplot theme
theme_nothing

Create a completely empty theme
theme_minimal_grid

Minimalistic themes with grids
insert_xaxis_grob

Insert an axis-like grob on either side of a plot panel in a ggplot2 plot.
rectangle_key_glyph

Create customizable legend key glyphs
panel_border

Add/remove the panel border in a ggplot2 plot
save_plot

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