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

Issue with scale_color_brewer #646

Open
ritu-rg opened this issue Jun 21, 2018 · 1 comment
Open

Issue with scale_color_brewer #646

ritu-rg opened this issue Jun 21, 2018 · 1 comment

Comments

@ritu-rg
Copy link

ritu-rg commented Jun 21, 2018

Hi,
I am getting the following error, while trying to use scale_color_brewer in any code:
ValueError: Invalid number for map type 'Diverging' and name 'BrBG'. Valid numbers are : [3, 4, 5, 6, 7, 8, 9, 10, 11]

I have tried with or without parameters - but they throw the same error:
scale_color_brewer(type='div')
or
scale_color_brewer()
or
scale_color_brewer(type='div', palette=4)

Example snippet:
ggplot(df, aes(x='col1', y='col2', color='col3')) +\ geom_point() +\ scale_color_brewer()

@chelmes
Copy link

chelmes commented Aug 2, 2018

Hi, based on not knowing what col3 is in your dataframe: ggplot is only able to handle strings as qualifiers. So convert df.col3's type to str (pd.DataFrame.astype, I believe) and everything should work.

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

2 participants