New features
-
New argument
cell.gridto draw a light rectangle around every cell (behind
the glyphs) and drop the through-center gridlines, so the sized glyphs
(method = "circle"orscale.square = TRUE) sit inside boxed cells -- the
corrplot boxed-cell look:ggcorrplot(corr, method = "circle", cell.grid = TRUE). The cell border color is set with the companion argument
cell.grid.col(default"grey90"). Defaults toFALSE; has no effect on a
full-tile square heatmap, whose tiles already carry anoutline.colorborder. -
New argument
scale.squareto size the squares by the absolute correlation
whenmethod = "square":ggcorrplot(corr, scale.square = TRUE)scales each
square (larger = stronger correlation) on top of the fill color, the classic
corrplot size-scaled square look. Defaults toFALSE(constant full-cell
squares, unchanged); has no effect formethod = "circle"(circles are always
sized). -
New argument
presetfor publication-grade output in one token:
ggcorrplot(corr, preset = "publication")sets white cell outlines and the
colorblind-safe"RdBu"palette. It only fills arguments you did not supply, so
anything you pass explicitly (e.g.outline.color,colors,palette)
overrides the preset. Defaults toNULL(no preset), leaving existing calls
unchanged. -
New argument
paletteto pick a built-in colorblind-safe diverging palette for
the fill gradient:ggcorrplot(corr, palette = "RdBu")(or"PuOr"). Each is
an 11-stop ramp with white at zero and the usual cool = negative / warm =
positive polarity, so it is a one-word alternative to spelling outcolors.
Defaults toNULL(usecolors), leaving existing calls unchanged. -
New value
insig = "stars"to mark the significant cells with significance
stars (***/**/*for p <= 0.001/0.01/0.05 -- fixed thresholds, not
sig.level) instead of crossing out the
insignificant ones. Works withoutlab, soggcorrplot(corr, p.mat = p.mat, insig = "stars")is a standalone significance map. The defaultinsig = "pch"
is unchanged. -
New arguments
lower.methodandupper.methodfor a mixed layout: a different
glyph per triangle, e.g. the coefficients as numbers in the lower triangle,
circles in the upper, and the variable names on the diagonal
(ggcorrplot(corr, lower.method = "number", upper.method = "circle")). Each
accepts "square", "circle" or "number"; both default toNULL, leaving the
single-method output unchanged (#85). Requested by @Breeze-Hu. -
New argument
hc.rectto draw rectangles around the clusters of a
hierarchically-ordered correlogram:ggcorrplot(corr, hc.order = TRUE, hc.rect = 3)frames the 3 clusters obtained by cutting the tree. Defaults to
NULL(no rectangles). The rectangle outline color is set with the companion
argumenthc.rect.col(default"gray30", e.g.hc.rect.col = "white").
Main changes
-
The plot axis is now always drawn in the matrix (row/column) order. This fixes
a bug wherehc.order = TRUEwas silently ignored for correlation matrices with
numeric-looking variable names (e.g."1","2", ...):reshape2::melt
type-converted such names to a continuous axis sorted by value, discarding the
clustering order (#37). As a consequence, theas.isargument no longer affects
the plot (it is kept only for backward compatibility) -- a call using
as.is = TRUE, which previously produced an alphabetically-ordered axis, now
follows the matrix order like every other call. Reported by @cabaez (#37). -
show.diag = FALSEon a non-square matrix no longer blanks the wrong cells.
The diagonal has no positional meaning for an m x n matrix, yet the removal
wipedmin(m, n)cells along the leading diagonal; it now removes only the
genuine self-pairs (a row and column naming the same variable), leaving a
matrix with disjoint row and column variables untouched. Square matrices, and
non-square matrices without dimnames, are unaffected. Follows up the non-square
support requested by @mt1022 (#5) and @qalid7 (#10).
Minor changes
-
Added an introductory vignette,
vignette("ggcorrplot"), walking through the
package end to end: the inputs, glyphs and layouts, clustering, coefficient
labels, significance styles, and theming. -
Added a second vignette,
vignette("publication-ready-correlation-plots"), a gallery of finished
publication-ready correlogram recipes (clustered, triangle, significance,
circle, colorblind palette, edgeless heatmap, rectangular predictor-by-outcome
matrix, and full ggplot2 polish). -
Internal refactor: the data-preparation pipeline and the glyph-layer
construction are now factored into internal helpers, with no change to the
output of any existing call. This is groundwork for forthcoming per-triangle
layout options. -
The help page and the README now link to the Datanovia correlation tutorials
for worked examples of the plot and of the p-value matrix.