Friday, April 10, 2015

ggpairs- Thoughts


When it works, it's really useful and the graphs are beautiful.
But there are times when I'm banging my head against the wall. Changing the font size of the diagonal plot... is impossible or I'm stupid (I Googled for hours though the latter is a lot more likely).

Here is the important part of the code (excluding some of the appearance sections):


ggpairs(pairwise.dat,axisLabels='internal',title = "Ecosystem Services",colour = "Shade",
###(put the data you want to look at, if you want the name of the variables in the diagonal plots then use- 'axisLabels = 'internal', if you don't have this 'axisLabels = 'internal' then the variable names are on the outside and the diagonal shows the distribution of each variable- can be turned into a histogram)
lower=list(continuous="points", params=list(size= 2.2),axisLabels = 'show'),=
###(lower means the graphs below the diagonal plots) 
upper=list(params=list(corSize=20)))
###(upper means the graphs above the diagonal plots)

Examples:



2 comments:

  1. Thank you! I was having trouble getting the labels to display in the diagonal plots, and this was the answer.

    ReplyDelete
  2. Very helpful, thanks!

    ReplyDelete