2

I am trying to use the labels argument in the Corrgram package to plot a vertical and horizontal axis but am having serious difficulty with it. I've tried passing my variable names through the labels argument but I still have my labels in the diagonal. My code below:

correlations <- c("var1","var2",...,"varx") ##Hosts my variable names.

corrgram(total.sub[,correlations],labels=correlations,lower.panel=panel.shade,upper.panel=panel.pie)

Edit: Below is a reproducible example:

library(corrgram)
a = c(19,21,31,41)
b = c(21,42,191,1)
c = c(1,2,3,4)
d = c(.1,39,42,1)
e = c(52,239,19,2)

df = data.frame(a,b,c,d,e)
correlations <-c("a","b","c","d","e")
corrgram(df[,correlations],labels=correlations,lower.panel=panel.shade,upper.panel=panel.pie)
EconDanny
  • 21
  • 3
  • Can you make your code reproducible by adding some data that will recreate your difficulty w/ this code? – gung - Reinstate Monica Aug 18 '13 at 00:59
  • You may turn the diagonal labels off by setting `labels = NULL`. Then you can try to add your labels where you wish by using `text`. See e.g. http://stackoverflow.com/questions/13367248/pairs-move-labels-to-sides-of-scatter-plot – Henrik Aug 18 '13 at 13:34
  • I want also know an answer to this thread. I extended it here with reproductible minimum example http://stackoverflow.com/q/40385321/54964 – Léo Léopold Hertz 준영 Nov 02 '16 at 16:46

0 Answers0