3

When plotting internal axisLabels for ggpairs, if numbers are large, they get cropped off.

fakedata <- data.frame(Var1=rnorm(500, 3, 6), 
                       Var2=runif(500, 0, 5500), 
                       Var3=rpois(500, 6), 
                       Var4=rpois(500, 1500),
                       Var5=runif(500, 1, 60))

ggpairs(fakedata, axisLabels= "internal")

enter image description here

In the graph above, the y-axis labels for Var2 are cut off, and the x-axis numbers for Var4 run together. How would I change the font size?

I've seen from this page that it may be possible to find a fix by adding theme() from ggplot2, but I can't find a theme element that would represent font size for axis text.

emudrak
  • 789
  • 8
  • 25
  • Let's try `help("wrap", package = "GGally")` – cuttlefish44 Jun 24 '16 at 20:46
  • 1
    @crayfish44; can you show how to do this please. I have tried `ggpairs(fakedata, axisLabels= "none", diag=list(continuous=wrap("diagAxis", gridLabelSize=3)))`, which changes the size, but `hjust` seems to be hard-coded, which it seems ro me is the parameter to be changed for the y-axis labels – user20650 Jun 24 '16 at 20:55
  • @user20650; I'd taken what OP wants that changing font size, so I inducted the method of using `ggally_xxx`. I know only `diag=list(continuous=wrap(ggally_diagAxis, ~ ))` and it is equivalent to what you say. I would have been comment it to save OP time and doesn't expect too much. Thank you for letting me realise the idea isn't enought to solve this question and so on. – cuttlefish44 Jun 24 '16 at 23:17
  • Thanks @crayfish44, I thought I was missing something obvious. So I guess the answer is to tweak ggally_diagAxis function, to allow for custom text justification, and use that instead. – user20650 Jun 25 '16 at 00:01

0 Answers0