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.

1
  • 1
    It's easier to help you if you include a simple 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. Commented Aug 15, 2023 at 19:38

1 Answer 1

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.