corrplot margin in plot window

Viewed 5025

I entered the commands below to develop a core plot. It works, but the plot shows up sandwiched against the bottom margin. Changing par(mar=c(5, 4, 4, 2) + 0.1) parameters has no impact on the placement of the corrplot. Ideas?

library(corrplot)
a <- seq(1,10,1)
b <- seq(2,20,2)
c <- seq(3,30,3)
z <- data.frame(a,b,c)
corrplot(cor(z))
2 Answers

Add the margins directly to the corrplot() call like this:

corrplot(cor(z), mar = c(1, 1, 1, 1))

I was running into trouble with this because setting margins within the function still clipped the axis labels, which in my case were relatively long site names. If you have long names for the rows/columns, in addition to using a mar() call within corrplot(), you may first need to call par(xpd = TRUE) to allow plotting in the margins.

Related