Skip to content
Back to formatted view

Raw Message

Message-ID: <9D37346F-B000-420B-BAD4-1909A9B2B844@mac.com>
Date: 2012-09-24T06:26:46Z
From: Andrew Digby
Subject: GGally diagonal axis: changing font size

ggpairs() from GGally is fantastic, but I'm stuck trying to change the diagonal labels and increase the size of the font in the diagonal axis plots.

I thought using ggally_diagAxis(... labelSize) would work, but it doesn't appear to. I've tried the following three approaches, all of which don't work (GGally 0.4.1, ggplot 0.9.2.1).

Any suggestions on what I'm doing wrong would be gratefully received.

Thanks,

Andrew


To change font size and label text in diagonal axis of ggpairs plot:

1) Using labelSize and gridLabelSize from ggally_diagAxis in params():

ggpairs(iris, colour="Species", params=c(labelSize=14, gridLabelSize=14))   # no effect

In fact, I can't get labelSize/gridLabelSize in ggally_diagAxis to work at all - changing the '14' for something else doesn't do anything:

ggally_diagAxis(iris,aes(x=Sepal.Length),labelSize=14, gridLabelSize=14)
ggally_diagAxis(iris,aes(x=Sepal.Length),labelSize=18, gridLabelSize=18)   # no change

And how to change the axis text (eg. to 'Sepal \nLength') in ggally_diagAxis?

2)  Using ggally_diagAxis or ggally_text:

giris <- ggpairs(iris, colour="Species")
g11<-ggally_diagAxis(iris,aes(x=Sepal.Length),labelSize=14, gridLabelSize=14)   # font size unchanged
g22<-ggally_text("Sepal\nLength", size=16)   # but how to get the axis labels?
giris<-putPlot(giris, g11, 1, 1)
giris<-putPlot(giris, g22, 2, 2)

3) Using theme (as suggested here: https://github.com/ggobi/ggally/issues/6)

theme_set(theme_grey(base_size=14))
ggpairs(iris, colour="Species", params=c(labelSize=14, gridLabelSize=14))    # font size unchanged