Streamlined Plot Theme and Plot Annotations for 'ggplot2'

Provides various features that help with creating publication-quality figures with 'ggplot2', 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.

Build Status Coverage Status CRAN_Status_Badge CRAN_Downloads_Badge

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.


cowplot 0.9.4

  • Fix CRAN check errors

cowplot 0.9.3

  • Fix regression tests to work with ggplot2 3.0.0

cowplot 0.9.2

  • Rewritten cowplot::ggsave function that calls ggplot2::ggsave
  • More robust handling of R graphics device weirdness/plots popping up in the wrong places

cowplot 0.9.1

  • Make examples and vignettes fail gracefully when magick package is not installed

cowplot 0.9.0

  • Added a theme for maps, theme_map(). Code provided by Spencer Fox,
  • Added axis_canvas() function and related functions to make marginal plots and plot annotations simpler
  • Now export the plot_to_gtable function which converts most anything into a gtable for further use with cowplot
  • Added inherit.aes = FALSE to draw functions where needed
  • Added examples to various draw functions
  • Added draw_image() function to draw images onto plots

cowplot 0.8.0

  • The function plot_grid can now also handle base-R (graphics) plots. Code provided by
  • More sophisticated plot alignments of complex plots are now possible. Code provided by Spencer Fox,
  • Plot labels can now be styled. In particular, they follow the theme settings, e.g. if the theme uses a different font than default. This closes issue #37.
  • The positioning of plot labels in plot_grid can now be controlled with additional position parameters label_x and label_y. This closes issue #32.
  • Problems with elements from globally set themes leaking into the plot-grid background have been fixed. This closes issues #60, #63, #66.

cowplot 0.7.0

  • This version of cowplot has been prepared for the upcoming release of ggplot2 2.2.0. As a result of this upcoming switch, the function switch_axis_position() has been removed. Alternative axes will be natively supported by ggplot2 2.2.0.
  • As of this version, cowplot requires R >= 3.3.0. This dependency was added because R 3.3 fixes a critical problem with lists of units.

cowplot 0.6.3

cowplot 0.6.2

  • Updated plot_grid vignette so the tutorial on aligning plots of different types works again. This stopped working at some point and was removed from 0.6.1.

cowplot 0.6.1

  • Added new convenience function draw_figure_label() to label figures with labels such as "Figure 1".
  • Fixes in switch_axis_position() so that rotated axis labels work.
  • Fix missing axis lines in ggplot2 2.1

cowplot 0.6.0

Major changes:

  • Now requires ggplot2 version 2.0.0 or higher. Use cowplot 0.5.0 with older versions of ggplot2.
  • Because of the dependency on ggplot2 2.0.0, the default design is changed. No more bold face for axis labels
  • Add auto-generation of labels in plot_grid()
  • Add vignettes describing plot annotations and shared legends among plots

cowplot 0.5.0

Major changes:

  • Fix label positioning in plot_grid() so it is not affected by the scale parameter
  • Add draw_label() function which can draw both text and plotmath expressions
  • Add parameters hjust and vjust to plot_grid() to allow fine-tuning of label position
  • Add annotations underneath plot, via add_sub() function

Other changes:

  • Improve vignettes

cowplot 0.4.0

Major changes:

  • Added a function switch_axis_position() which can move/copy the x and/or y axis of a plot to the other side
  • plot_grid() can now align graphs
  • plot_grid() can now make grids with varying column widths and row heights

Other changes:

  • Various improvements in the documentation
  • Code has been separated into multiple files for easier maintenance

cowplot 0.3.1

Fix Vignette title

cowplot 0.3.0

First complete implementation ready for initial release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.1.1 by Claus O. Wilke, 10 months ago

Report a bug at

Browse source code at

Authors: Claus O. Wilke [aut, cre]

Documentation:   PDF Manual  

GPL-2 license

Imports ggplot2, grid, gtable, grDevices, methods, rlang, scales

Suggests Cairo, covr, dplyr, forcats, gridGraphics, knitr, lattice, magick, maps, PASWR, patchwork, rmarkdown, ragg, testthat, tidyr, vdiffr, VennDiagram

Imported by AirSensor, BayesMallows, CIMTx, ClinicalUtilityRecal, CoSMoS, CovidMutations, ESTER, EpiNow2, FitUltD, HuraultMisc, ITNr, KMunicate, PhenotypeSimulator, RavenR, Seurat, TITAN2, TcGSA, TooManyCellsR, TreeDiagram, agroclim, andurinha, anomaly, bayefdr, bayes4psy, bigstatsr, biogrowth, bp, bridger, bruceR, causact, ccdf, cdcatR, colorBlindness, conos, conserveR, cosinor2, cylcop, cytometree, dabestr, disaggregation, dragon, epcc, epos, ethnobotanyR, fairadapt, flashlight, foodingraph, foreSIGHT, gWQS,, ggResidpanel, gggap, ggpubr, harmony, healthcareai, healthyR, healthyR.ts, iai, inTextSummaryTable, lvmisc, mbRes, mcmcabn, mdthemes, memery, memoria, metacoder, metapower, microplot, mlergm, moveVis, multilevelTools, neutralitytestr, oolong, opitools, pathviewr, patientProfilesVis, plinkQC, promethee123, psrwe, qad, qsort, scatr, sigminer, sleepwalk, specr, ssMousetrack, survivalAnalysis, telefit, text, tidyMicro, umx, valse, vanddraabe, vici, virtualPollen, visR, yaps.

Depended on by rliger.

Suggested by ClusTorus, DGCA, PCMBase, PKNCA, Platypus, RaJIVE, UCSCXenaShiny, WASP, afex, arcpullr, blockCV, concurve, dataquieR, deconvolveR, denvax, distributions3, dsb, ec50estimator, epifitter, evolqg, fMRIscrub, faux, gap, genekitr, geodiv, ggdist, ggplotify, ggtext, ghibli, grainscape, himach, httk, ibawds, incidence, interactions, meme, mets, mlr, mmb, modcmfitr, multifear, multiverse, nCov2019, opticskxi, pcr, phateR, poppr, portalr, primer, psycModel, ricu, runstats, sdmApp, sicegar, singleCellHaystack, sjPlot, spiralize, stabm, tidybayes, tinyarray, tvthemes, valr, vimp.

Enhanced by flowr.

See at CRAN