corrplot을 사용하여 상관 관계 히트 맵을 만들었지 만 기본 범례가 마음에 들지 않습니다. 너무 큽니다.
그래서 플롯을 만들고 (cl.pos = "n"을 사용하여 기본 범례를 사용하지 않도록 설정 한) colorlegend()를 사용하여 범례를 추가하려고했습니다.
유일한 문제는 내가 범례의 위치를 변경하는 방법을 알아낼 수 없다는 것입니다. 왼쪽 하단에서 끝납니다. 이상적으로는 오른쪽 상단에 배치 할 수 있지만 colorlegend 및 음모 및이 알아낼 수 없습니다.그래픽에 colorlegend (corrplot)을 배치하는 방법
# load libraries and create color scale
library(corrplot)
library(RColorBrewer)
scalebluered <- colorRampPalette(brewer.pal(8, "RdBu"))(8)
# get data into correlation matrix
data(mtcars)
cars.matrix <- as.matrix(mtcars[c(2:8)])
cars.corr <- cor(cars.matrix)
# plot it
corrplot(cars.corr, method="shade", shade.col=NA, tl.col="black",
tl.srt=45, addgrid.col="black", type="lower", diag=FALSE, cl.pos="n")
# add legend
colorlegend(scalebluered, c(seq(-1,1,.25)), align="l", vertical=TRUE, addlabels=TRUE)
출력 : 이런 screenshot of output with badly placed legend http://i42.tinypic.com/14wsqc0.png
기본 범례는 상관 관계 격자와 같지 않기 때문에 나는 그렇지 않습니다. 나는 더 작은 것을 원합니다. 그리고 내가 원하는 곳에 배치 할 수 있습니다. 이상적으로, 다음과 같은 것 : http://i44.tinypic.com/350qssm.png – Paul