0

I draw a plot using ggpairs (like below) but it looks very confusing. As to fix it, I have read the documentation but that did not help much.

[1]

How can I reduce the font size of the coefficients?

And second, I'm wondering how this plot can be improved in a more readible way. Maybe it can be done in terms of regualting scattor plots or labeling? If anyone has an idea, please let me know what and how to do.

Here is the code that I wrote for the plot.

ggpairs(wine_subset[sample.int(nrow(wine_subset), 1000), ], 
        upper = list(wrap(ggally_cor, size = 2))) 
erc
  • 10,113
  • 11
  • 57
  • 88
Brian
  • 251
  • 4
  • 14

1 Answers1

1

The simplest solution would be making the height and width of the saving file larger. Here are some examples. Please have a look at how the outcomes look different.

  library(GGally)
  library(data.table)
  sample_data <- data.table(a = rnorm(1000))
  for(i in 2:12) sample_data[, letters[i] := rnorm(100) ]
  head(sample_data)
  g <- ggpairs(sample_data, 
          upper = list(wrap(ggally_cor, size = 2))) 
  ggsave("temp1.pdf", g, width = 6, height = 6)
  ggsave("temp2.pdf", g, width = 9, height = 9)
  ggsave("temp3.pdf", g, width = 12, height = 12)
  ggsave("temp1.png", g, width = 6, height = 6)
  ggsave("temp2.png", g, width = 9, height = 9)
  ggsave("temp3.png", g, width = 12, height = 12)
amatsuo_net
  • 2,409
  • 11
  • 20