0

I just want to do a simple correlation matrix plot. If I do:

library(GGally)
data(flea)
ggpairs(flea, columns = 2:4)

I get these strange numbers in the top triangle: enter image description here

Why?

First, I installed the CRAN version, and it happened to me. Right now, I have the GitHub version, and the same thing happens to me.

R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
  • Can you try this command: `ggpairs(flea, columns = 2:4, upper=list(continuous = "cor_v1_5")`? I think your problem is due to a missing font in your system but I haven't found which one yet. – Vincent Guillemot Aug 11 '20 at 12:32
  • Found it in the help file `?ggally_statistic`. The font family = "mono" is used for these parts of the pair plot. – Vincent Guillemot Aug 11 '20 at 12:35
  • So if your problem is really related to a missing font, then you should have the same issue with the command `plot(1:10, family = "mono")`. Is this the case? – Vincent Guillemot Aug 11 '20 at 12:37
  • Yes Vincent! I have the same problem with `r plot(1:10, family = "mono")`. However, `ggpairs(flea, columns = 2:4, upper=list(continuous = "cor_v1_5"))` works fine for me. Do I need to install mono font in Ubuntu or R? – Guilherme Parreira Aug 11 '20 at 12:40
  • I think you need to install something like `xfonts`. Just out of curiosity: what happens when you save your plot in a pdf device with the command `pdf("testmono.pdf");plot(1:10, family = "mono");dev.off()` ? – Vincent Guillemot Aug 11 '20 at 12:47
  • It saves correctly. When I tried `sudo apt install xfonts-utils`, it says that it is already in the newest version – Guilherme Parreira Aug 11 '20 at 13:17
  • It has to be one of the xfonts packages – Vincent Guillemot Aug 12 '20 at 08:18

0 Answers0