Extension to 'ggplot2'

The R package 'ggplot2' is a plotting system based on the grammar of graphics. 'GGally' extends 'ggplot2' by adding several functions to reduce the complexity of combining geometric objects with transformed data. Some of these functions include a pairwise plot matrix, a two group pairwise plot matrix, a parallel coordinates plot, a survival plot, and several functions to plot networks.

Master: Build Status codecov.io CRAN_Status_Badge DOI

Dev: Build Status codecov.io

Join the chat at https://gitter.im/ggobi/ggally

ggplot2 is a plotting system for R based on the grammar of graphics. GGally extends ggplot2 by adding several functions to reduce the complexity of combining geoms with transformed data. Some of these functions include a pairwise plot matrix, a scatterplot plot matrix, a parallel coordinates plot, a survival plot, and several functions to plot networks.


To install this package from Github or CRAN, do the following from the R console:

# Github


GGally 1.3.3

ggpairs and ggduo

  • Become ggplot2 v2.2.2 compliant (#266)
  • When retrieving functions with wrap, ggally_* functions do not require the GGally namespace (#269)
  • Exported eval_data_col, mapping_string, and mapping_swap_x_y (5d157f6)
  • Exported is_horizontal and is_character_column (#270)
  • Logical values are now treated as discrete (#272)


  • progress parameter added to ggmatrix (and appropriate parent functions). Allows for TRUE, FALSE, NULL, and function(pm){...} (#271)


  • Cooks distance cutoff is now at F_{p, n - p}(0.5) (#274)


  • Replaced loading packages with loading namespaces(#262)


  • Added shrink and se parameters to ggally_smooth (#247)


  • Added sort parameter to sort by beta values (#273)


  • Fixed bug where x axis breaks and labels did not appear when splineFactor = TRUE (#279)

GGally 1.3.2

ggpairs and ggduo

  • Removed warning where pure numeric names gave a warning (#238, @lepennec)
  • Fixed ordering issue with horizontal boxplots (#239)


  • Fixed missing x aes requirement when shadebox is provided (#237, @treysp)


  • Made igraph a non required dependency for tests (#240)

GGally 1.3.1

Added new dataset psychademic

  • See ?psychademic for more details
  • (And updated the broken UCLA links)

Added original ggmatrix theme

  • added function to set theme to have clear strip background and rearrange the strip positions
  • added parameter switch to ggmatrix (and friends) to allow for strip repositioning. See ?ggplot::facet_grid for more documentation on switch (#223, #224)

ggsurv error reporting

  • removed a one error check that is covered in other places (#222)


  • allow to add a list of items to a ggmatrix (#228)


  • fix strip issues with ggplot2 name update

GGally 1.3.0

ggmatrix.print - massive update!

  • Now prints with a ggplot2 facet'ed structure
  • Column titles are now placed in the strip of a plot matrix
  • If there are 16 plots or more, a progress bar is displayed automatically (if interactive). Please look at the documentation for ggmatrix_gtable more details.

ggmatrix legend

  • A legend may be added with the legend parameter in ggduo, ggpairs, and ggmatrix
  • May specify a (length two) numeric plot coordinate
  • May specify a (length one) numeric plot position
  • May specify a legend object retrieved from grab_legend

ggnostic - New function!

  • Produces a ggmatrix of diagnostic plots from a model object
  • Uses broom to retrieve model information
  • Each column of the plot matrix is a predictor variable. The rows can display the response variables, fitted points, residuals, standardized residuals, leave one out model sigma values, diagonals of the hat matrix, and cook's distance for each point.

ggfacet - New function!

  • Produces single ggplot2 object
  • interface is very similar to ggduo and ggpairs

fn_switch - New function!

  • Provide many functions in a list but only call one function at run time according to a mapping value
  • Useful for ggnostic for different behavior depending on the y variable
  • Allows for a 'default' value for the default switch case

ggmatrix - allow custom labellers for facet labels

  • Added labeller parameter which is supplied to ggplot2::facet_grid()
  • Allows for labels with plotmath expressions

ggmatrix and ggplot2::last_plot()

  • If a ggmatrix object is printed, ggplot2::last_plot() will return the plot matrix

ggmatrix and ggplot2 labels

  • ggplot2::labs +'ed to a ggmatrix object
  • ggplot2::xlab and ggplot2::ylab may be +'ed to a ggmatrix object
  • ggplot2::ggtitle +'ed to a ggmatrix object
  • (anything that returns a class of "labels" may be added to a ggmatrix object)

ggmatrix and ggplot2::ggsave()

  • ggsave now works with ggmatrix objects

ggpairs and ggduo check for cardinality (#197)

  • Before creating a ggmatrix object, a check is made for character/factor columns
  • If there are more than 15 (default) unique combinations, an error is thrown.
  • Setting cardinality_threshold parameter to a higher value can fix the problem (knowing single cell plots may take more time to produce)
  • Setting cardinality_threshold parameter to NULL can stop the check

ggmatrix plot proportions

  • ggmatrix can set the plot proportions with the parameters xProportions and yProportions
  • These will change the relative size of the plot panels produced.

ggally_cor colour aesthetic

  • color must be a non-numeric value


  • added boolean to allow for legend to not be sorted
  • fixed bug where censored points with custom color didn't match properly (#185)


ggally_box_no_facet and ggally_dot_no_facet

  • New methods added as defaults to pair with new ggmatrix print method

GGally 1.2.0

install requirements

  • relaxed install requirements on grid (5d06dfc, d57469a, 933bb14, 73b314d)

ggduo - New!

  • plot two grouped data in a plot matrix (#173)
  • helpful for plotting two sets of columns, multivariate analysis, and canonical correlation analysis
  • be sure to check out the examples!

ggally_smooth_loess - New!

  • uses the loess method with drawing a line (1552f96)

ggally_smooth_lm - New!

  • uses the lm method with drawing a line (1552f96)
  • alias of ggally_smooth


  • fixed bug strips where causing spacing issue when printing axis labels (174630d)


  • fixed bug where checking for the package 'intergraph' couldn't be reached


  • changed default of plotting multiple censored data color to match the survival line

package testing

  • added many more tests!

GGally 1.1.0

ggcoef - New!

  • plot model coefficients with broom and ggplot2 PR#162
  • Plotting model coefficients (http://www.r-statistics.com/2010/07/visualization-of-regression-coefficients-in-r/)

gglegend - New!

  • pull out the legend of a plot which can also be used in ggpairs PR#155, PR#169


  • fixed bug where '...' was not respected (d0fe633)


  • added 'method' parameter (411213c)


  • Does not call ggfluctuation2 anymore. PR#165


  • fixed issue with unnamed correlation matrix used as input PR#146
  • fixed issue undesired shifting when layout.exp was > 0 PR#171


  • is being deprecated. Please use ggally_ratio instead PR#165


  • fixed issue with overlaying network on a world map PR#157


  • Fixed odd bug where a list was trying to be forced as a double PR#162


  • Fixed improperly rotated axes with ggally_ratio PR#165


  • added 'corMethod' parameter for use in upper triangle PR#145


  • size.est and size.ci parameters added PR#153
  • ordering changed to reflect survival time PR#147
  • added a vignette PR#154


  • documentation updated PR#152
  • changes default behavior only. If an argument is supplied, the argument will take precedence

github chat


  • cache packages for faster checking
  • install covr and lintr from github for testing purposes

GGally 1.0.1


  • fix handling of factor group variable PR#131


  • force all char columns to factors PR#134


  • add boolean for grid.newpage ggmatrix print method PR#126

GGally 1.0.0


  • GGally has been upgraded to run on the latest ggplot2 v1.1.0. PR#109

New functions

  • ggmatrix. Make a generic matrix of ggplot2 plots
  • ggnetworkmap. Plot a network with ggplot2 suitable for overlay on a ggmap::map ggplot, or other ggplot
  • ggnet2. Function for plotting network objects using ggplot2, with additional control over graphical parameters that are not supported by the ggnet function


  • glyph - new!
  • ggmatrix - new!
  • ggnetworkmap - new!
  • ggpairs - new!
  • ggscatmat - new!


  • allows for bracket notation when getting or setting plots. PR#61
  • full control over axis labels and axis text. PR#107, PR#111


  • is now wrapper to ggmatrix
  • takes in 'wrapped' functions. This better handles the case of many different parameters being supplied to different plot types. PR#90
  • dates are better handled in ggpairs. Still room for improvement for default behavior, but they do not cause errors. PR#58, PR#59
  • displays a 'NA' plot when all or a combination of the data is NA. PR#119


  • legend title expressions may be used. PR#55
  • handles objects that may be coerced into a data.frame PR#70


  • changed geom_line to geom_path in gglyph. Fixes ordering issue. PR#51


  • remaining columns are passed through so aesthetics may be added later. PR#54
  • fixed parcoord ordering issues with odd names. PR#106
  • fixed scaling when unique length equals 1. PR#122


  • color censored marks the same color as the line. PR#74
  • allow for different censored color marks. PR#113


  • add fake data points to extend the limits of the stat_density2d. PR#114


  • new plot type!


  • removed cityServiceFirms
  • added twitter_spambots

Reference manual

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


2.1.2 by Barret Schloerke, 4 months ago

https://ggobi.github.io/ggally/, https://github.com/ggobi/ggally

Report a bug at https://github.com/ggobi/ggally/issues

Browse source code at https://github.com/cran/GGally

Authors: Barret Schloerke [aut, cre] , Di Cook [aut, ths] , Joseph Larmarange [aut] , Francois Briatte [aut] , Moritz Marbach [aut] , Edwin Thoen [aut] , Amos Elberg [aut] , Ott Toomet [ctb] , Jason Crowley [aut] , Heike Hofmann [ths] , Hadley Wickham [ths]

Documentation:   PDF Manual  

GPL (>= 2.0) license

Imports dplyr, forcats, grDevices, grid, gtable, lifecycle, plyr, progress, RColorBrewer, reshape, rlang, scales, tidyr, utils

Depends on ggplot2

Suggests broom, broom.helpers, chemometrics, geosphere, ggforce, Hmisc, igraph, intergraph, labelled, maps, mapproj, nnet, network, scagnostics, sna, survival, rmarkdown, roxygen2, testthat, crosstalk, knitr, spelling, emmeans

System requirements: openssl

Imported by AirSensor, AntMAN, BGGM, BasketballAnalyzeR, CARBayes, CARBayesST, CINNA, DescribeDisplay, EGAnet, FPDclustering, GDAtools, GGMnonreg, HierDpart, ICtest, ITNr, LANDD, MAINT.Data, MRPC, MixtureMissing, NetworkChange, OutliersO3, PAsso, PopGenReport, SmartEDA, WRSS, adventr, bootcluster, brinton, clustrd, communication, conserveR, discourseGT, ezEDA, finalfit, fingerPro, ggPMX, ggmcmc, ggquickeda, glancedata, greed, growthPheno, gsynth, imageData, jmv, jsmodule, metan, mgcViz, mlergm, psyntur, randomForestExplainer, rassta, rbioacc, robCompositions, rrr, rwty, specmine, staRdom, statVisual, vivid, vortexR.

Depended on by RHMS, freqparcoord.

Suggested by AlleleShift, BAS, EMMIXmfa, PPforest, ParamHelpers, QuantNorm, SHELF, SimBIID, WRS2, airGR, bayestestR, bruceR, comparer, eechidna, fic, fpp2, gfilmm, gtsummary, httk, loon.ggplot, miWQS, mlr3viz, mlrMBO, nzelect, plotly, qualvar, robustbase, rosetta, sageR, seer, spinifex, spup, tidyseurat, tsfeatures, ubiquity, ufs, ushr, wildlifeDI.

See at CRAN