How do I put a downloaded palette on an imported dataframe?

Hello
I imported a dataframe from excel and could plot what I needed just fine
(used the code ggplot(D1,aes(x=x1,y=y1)) + geom_point() + geom_smooth(method='lm') linearMod1 <- lm(y1 ~ x1, data=D1) print(linearMod1)
but the problem is, once I started searching how to make it pretty, I found a premade set of palettes and downloaded the package (wesanderson) and wanted to use the GrandBudapest1 palette that comes with it, but I don't quite know what and where to put on the code to make it work.
Thank you for your help already, and sorry if my English isn't the best.

Assuming you loaded the library you just add the code:

library("wesanderson")

ggplot(D1,aes(x=x1,y=y1)) + geom_point() + geom_smooth(method='lm') +
scale_fill_manual(values = wes_palette("GrandBudapest1"))

Use fill, colour, shape, etc. based on what parts you want colored.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.