0

I have the ggplot2 and GGally package and library installed. When I run this code, the font in the diagonal is too large so that it's unreadable (see attached image).

ggpairs(hrdata, columns= c(1,8,19,29), title="Scatterplot Matrix", aes(color=EducationField))
   + scale_fill_manual(values=cbPalette)
   + scale_colour_manual(values=cbPalette)
   + theme_grey(base_size=8)

When I try to add upper=list(continuous=wrap('cor', size=8)), I get the error:

Error: unexpected ','

I am guessing it has something to do with 'cor', but I'm not sure what that represents or how to change it.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Where exactly did you add the "upper=" part? Did you have an extra comma at the end? Looks like a syntax error. – MrFlick Aug 15 '23 at 19:38

1 Answers1

0

My problem was the title (should have been using ggtitle). I figured it out trying to get a reproducible example with Iris.

ggpairs(iris, aes(color=Species), upper= list(continuous=wrap('cor', size=3)))+ ggtitle("Scatterplot Matrix")+ scale_fill_manual(values=cbPalette)+ scale_colour_manual(values=cbPalette)+ theme_grey(base_size=8)
toyota Supra
  • 3,181
  • 4
  • 15
  • 19