Skip to content
Back to skills

Corrplot

ASecurity

R corrplot package for correlation matrix visualization. Use for creating beautiful correlation heatmaps and plots.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added June 5, 2026
datagoangulartestinggit

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill corrplot --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Corrplot?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Corrplot
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-corrplot/badge)](https://www.skillsdirectory.com/skills/leolin990405-corrplot)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: corrplot
description: R corrplot package for correlation matrix visualization. Use for creating beautiful correlation heatmaps and plots.
---

# corrplot

Graphical display of correlation matrices.

## Basic Usage

```r
library(corrplot)

# Compute correlation matrix
cor_matrix <- cor(mtcars)

# Basic plot
corrplot(cor_matrix)

# Different methods
corrplot(cor_matrix, method = "circle")   # Default
corrplot(cor_matrix, method = "square")
corrplot(cor_matrix, method = "ellipse")
corrplot(cor_matrix, method = "number")
corrplot(cor_matrix, method = "shade")
corrplot(cor_matrix, method = "color")
corrplot(cor_matrix, method = "pie")
```

## Layout Types

```r
# Full matrix
corrplot(cor_matrix, type = "full")

# Upper triangle
corrplot(cor_matrix, type = "upper")

# Lower triangle
corrplot(cor_matrix, type = "lower")
```

## Ordering

```r
# Hierarchical clustering order
corrplot(cor_matrix, order = "hclust")

# First principal component order
corrplot(cor_matrix, order = "FPC")

# Angular order of eigenvectors
corrplot(cor_matrix, order = "AOE")

# Alphabetical
corrplot(cor_matrix, order = "alphabet")

# Original order
corrplot(cor_matrix, order = "original")
```

## Clustering

```r
# Add rectangles around clusters
corrplot(cor_matrix, order = "hclust", addrect = 3)

# Customize clustering
corrplot(cor_matrix,
  order = "hclust",
  hclust.method = "ward.D2",
  addrect = 4,
  rect.col = "red"
)
```

## Color Schemes

```r
# Custom color palette
corrplot(cor_matrix, col = colorRampPalette(c("blue", "white", "red"))(200))

# COL1 and COL2 palettes
corrplot(cor_matrix, col = COL1("YlOrRd"))
corrplot(cor_matrix, col = COL2("RdBu"))

# Reverse colors
corrplot(cor_matrix, col = rev(COL2("RdBu")))
```

## Labels and Text

```r
# Add correlation coefficients
corrplot(cor_matrix, addCoef.col = "black")

# Customize text
corrplot(cor_matrix,
  addCoef.col = "black",
  number.cex = 0.7,
  number.digits = 2
)

# Text labels
corrplot(cor_matrix,
  tl.col = "black",
  tl.srt = 45,        # Rotation angle
  tl.cex = 0.8        # Text size
)
```

## Significance Testing

```r
# Compute p-values
library(Hmisc)
res <- rcorr(as.matrix(mtcars))
cor_matrix <- res$r
p_matrix <- res$P

# Show only significant correlations
corrplot(cor_matrix,
  p.mat = p_matrix,
  sig.level = 0.05,
  insig = "blank"     # Hide non-significant
)

# Mark non-significant with X
corrplot(cor_matrix,
  p.mat = p_matrix,
  sig.level = 0.05,
  insig = "pch",
  pch = "X"
)

# Show confidence intervals
corrplot(cor_matrix,
  p.mat = p_matrix,
  insig = "label_sig",
  sig.level = c(0.001, 0.01, 0.05),
  pch.cex = 0.9
)
```

## Mixed Plots

```r
# Upper and lower different methods
corrplot.mixed(cor_matrix,
  lower = "number",
  upper = "circle",
  tl.col = "black"
)

# Customize mixed
corrplot.mixed(cor_matrix,
  lower = "shade",
  upper = "pie",
  order = "hclust"
)
```

## Customization

```r
corrplot(cor_matrix,
  method = "color",
  type = "upper",
  order = "hclust",
  addCoef.col = "black",
  tl.col = "black",
  tl.srt = 45,
  diag = FALSE,       # Hide diagonal
  cl.pos = "b",       # Color legend position
  cl.ratio = 0.2,     # Color legend size
  title = "Correlation Matrix",
  mar = c(0, 0, 2, 0)
)
```

## Background and Grid

```r
corrplot(cor_matrix,
  addgrid.col = "gray",
  bg = "white",
  outline = TRUE
)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.