Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in wes_palette(n = 3, "GrandBudapest") : Palette not found. #33

Open
ThomasPepperz opened this issue Dec 22, 2018 · 6 comments
Open

Comments

@ThomasPepperz
Copy link

ThomasPepperz commented Dec 22, 2018

ggplot(df, mapping = aes(published.on.the.dn, fill = published.on.the.dn) ) +
 geom_bar(stat = 'count') +
  labs(x = "Published on the DN?", 
       y = "Count", 
       title = TitleXYZ",
       fill = "Legend") +
  theme(plot.title = element_text(hjust = 0.5)) +
  scale_fill_manual((values=wes_palette(n = 3, "GrandBudapest")))

Error in wes_palette(n = 3, "GrandBudapest") : Palette not found.

R.version

OUTPUT:
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          5.1                         
year           2018                        
month          07                          
day            02                          
svn rev        74947                       
language       R                           
version.string R version 3.5.1 (2018-07-02)
nickname       Feather Spray  
@kbroman
Copy link

kbroman commented Dec 22, 2018

You need to use wes_palette(n=3, "GrandBudapest1") or wes_palette(n=3, "GrandBudapest2").

@ThomasPepperz
Copy link
Author

ThomasPepperz commented Dec 22, 2018

  scale_fill_manual((values=wes_palette(n = 2, "GrandBudapest1")))

Error: Insufficient values in manual scale. 2 needed but only 0 provided.

@kbroman Karl, thank you for the quick reply. If you have time, the adjusted code is incurring the above error as well. By the way, bravo for dedicating the time to import the wonderful color of Wes Anderson's films into R. Very, very cool.

@kbroman
Copy link

kbroman commented Dec 22, 2018

Seems like that extra set of () is messing things up; I'm not sure why. Try

scale_fill_manual(values=wes_palette(n = 2, "GrandBudapest1"))

@ThomasPepperz
Copy link
Author

I think I did remove them after I posted the that last error message, but let me try again. If you're not seeing anything wrong with the code itself or my R Version output then it must be something going on with my data or the way I've constructed my ggplot( ) call, which of course is not your fault. This is the point of troubleshooting error messages I suppose. I don't know how often I just tweaked a ridiculous part of the code and then everything worked for no reasonable explanation.

The only thing that is troubling me is the error messages I'm receiving is recognizing I am trying to supply a number for the values argument but won't work no matter what value I input.

Error: Insufficient values in manual scale. 2 needed but only 0 provided.
                                                                            ... blah blah... +
scale_fill_manual(wes_palette(n = 4, "GrandBudapest2"))
Error: Insufficient values in manual scale. 4 needed but only 0 provided.

I tried it on a different ggplot I created and still having trouble. Oh well. I appreciate your assistance and for creating the wesanderson package. Go ahead and close the issue since it seems to be something on my end as opposed to the package's end and when I come across the solution or my work-around I will go ahead and post it for the sake of posterity.

@juana-mu
Copy link

juana-mu commented Jun 7, 2019

Hi!
I'm glad you didn't close this, I was having the same issue and fixed it by deleting the "n=". Give it a try!

@ThomasPepperz
Copy link
Author

ThomasPepperz commented Jun 8, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants