r-corrplot

R: Titles cut in half with par()

烈酒焚心 提交于 2019-12-19 20:12:08
问题 I have this figure: require(corrplot) par(oma=c(0,0,2,0), mfrow = c(1, 3)) for (country in c("Italy","Germany","Afghanistan")) { corrplot.mixed(cor(data.frame(v1=rnorm(40), v2=rnorm(40), v3=rnorm(40), v4=rnorm(40), v5=rnorm(40), v6=rnorm(40), v7=rnorm(40), v8=rnorm(40)), use="pairwise.complete.obs"), main=country) } par(mfrow = c(1, 1)) which produces titles cut in half: Following this answer I set oma=c(0,0,2,0) but it does't affect the results. I am not sure which margin I should modify. I

R: Titles cut in half with par()

落爺英雄遲暮 提交于 2019-12-19 20:07:23
问题 I have this figure: require(corrplot) par(oma=c(0,0,2,0), mfrow = c(1, 3)) for (country in c("Italy","Germany","Afghanistan")) { corrplot.mixed(cor(data.frame(v1=rnorm(40), v2=rnorm(40), v3=rnorm(40), v4=rnorm(40), v5=rnorm(40), v6=rnorm(40), v7=rnorm(40), v8=rnorm(40)), use="pairwise.complete.obs"), main=country) } par(mfrow = c(1, 1)) which produces titles cut in half: Following this answer I set oma=c(0,0,2,0) but it does't affect the results. I am not sure which margin I should modify. I

Correlation Corrplot Configuration

别说谁变了你拦得住时间么 提交于 2019-12-17 18:42:59
问题 I am newbie in R scripts :-) I need build a correlation matrix and I´am trying to configurate some parameters to adapt the graph. I am using the corrplot package. I Built a corrplot matrix this way: corrplot(cor(d1[,2:14], d1[,2:14]), method=c("color"), bg = "white", addgrid.col = "gray50", tl.cex=1, type="lower", tl.col = "black", col = colorRampPalette(c("red","white","blue"))(100)) I need show the values of correlation in the lower matrix inside the color matrix that I built. How i can do

Corrplot label printing

牧云@^-^@ 提交于 2019-12-13 19:30:22
问题 This can be thought of as a continuum of my earlier question - R - corrplot correlation matrix division - so let's use the same example data here as well. df <- data.frame(x1 = rnorm(20), x2 = rnorm(20), x3 = rnorm(20), x4 = rnorm(20), x5 = rnorm(20), x6 = rnorm(20), x7 = rnorm(20), x8 = rnorm(20), x9 = rnorm(20), x10 = rnorm(20), x11 = rnorm(20), x12 = rnorm(20)) cormatx <- cor(df) corrplot(cormatx, method = "color") Now I can alter the position of the labels by adding tl.pos = ... , which,

How to change the margins of a correlation matrix plot?

你。 提交于 2019-12-12 18:26:00
问题 I couldn't find any option to expand the margins for plot generated by corrplot.mixed in the corrplot package. Any suggestion would be appreciated! library(corrplot) cor_matrix <- structure(c(1, 0.31596392056465, -0.120092224085334, -0.345097115278159, 0.31596392056465, 1, 0.158912865564527, -0.606426850726639, -0.120092224085334, 0.158912865564527, 1, -0.134795548155303, -0.345097115278159, -0.606426850726639, -0.134795548155303, 1), .Dim = c(4L, 4L), .Dimnames = list(NULL, c("var_1", "var_2

how to place colorlegend (corrplot) in graphic

谁说胖子不能爱 提交于 2019-12-12 09:49:03
问题 I am using corrplot to create a correlation heatmap, but I don't like the default legend - it is too big. So I was trying to use the colorlegend() to add the legend after I create the plot (and disable the default legend with cl.pos="n" ). Only problem is that I can't figure out how to change the position of the legend - it ends up on the lower left. Ideally, I could place it on the top right, but I looked through the options for colorlegend and plot and can't figure this out. For example: #

R - corrplot correlation matrix division

醉酒当歌 提交于 2019-12-11 12:29:05
问题 Here I make an example 12x12 correlation matrix: df <- data.frame(x1=rnorm(20),x2=rnorm(20),x3=rnorm(20),x4=rnorm(20),x5=rnorm(20),x6=rnorm(20),x7=rnorm(20),x8=rnorm(20),x9=rnorm(20),x10=rnorm(20),x11=rnorm(20),x12=rnorm(20)) cormatx <- cor(df) corrplot(cormatx, method="color") I was wondering how this one output could be divided in to four separate 6x6 matrixes? Here is an image of how the output should be divided. I hope this makes sense. 回答1: Like this? par(mfrow = c(2,2)) corrplot(cormatx

Plotting multiple corrplots (R) in the same graph

余生长醉 提交于 2019-12-10 23:59:58
问题 Is it possible to plot several corrplot graphs in a single graph? Reproducible example: library(corrplot) data(mtcars) M <- cor(mtcars) col1 <- colorRampPalette(c("#7F0000","red","#FF7F00","yellow","white", "cyan", "#007FFF", "blue","#00007F")) corrplot(M, method="color", col=col1(20), cl.length=21,order = "AOE", addCoef.col="grey") corrplot(M, method="square", col=col1(200),order = "AOE") corrplot(M, method="ellipse", col=col1(200),order = "AOE") corrplot(M, method="shade", col=col1(20)

How to change color scheme in corrplot

落爺英雄遲暮 提交于 2019-12-10 14:37:08
问题 I am using corrplot in R to visualise a correlation-coefficient matrix as follows. library(corrplot) library(datasets) corrplot(abs(cor(mtcars)), method="color", tl.pos="n", cl.lim = c(0,1)) The default colour scheme is blue -based. However, I would like to change it to red -based. I know I need to use colorRampPalette to specify colours I want. However, I could not figure out what colour codes to use. Could anyone help me with this, please? Thank you! 回答1: If you want to use red, you can

R corrplot colorlegend change range

試著忘記壹切 提交于 2019-12-07 08:34:02
问题 I am trying to plot in R a correlation matrix using the corrplot package. My problem is that the range of min and max correlation coefficients of the entire matrix is (-0.2,0.2). I plot the matrix with corrplot and I use a custom colorRampPalette , say col1<-colorRampPalette(c('red','yellow','green','blue')) for the colormap of the legend, so I set col=col1(10) , and I set cl.lim=c(-0.2,0.2) . When I see the plot however the colorlegend appears from -0.2 to 0.2 but with just 2 colors, instead