Issues with plotting categorical in 'figure'

Hi,
Please excuse me if I missed something, since I have started using bokeh recently, but for some reason I am having issues:

  1. This works:

Scatter(sectionHour, x=‘Section+Hour of the day (EST)’, y=‘Number of Posts’)

but this does not:

s1 = figure(title=“Posts with clicks”, width=800, height=400)

s1.add_tools(HoverTool())

s1.circle(sectionHour[‘Section+Hour of the day (EST)’], sectionHour[‘Number of Posts’], size=7, color=“navy”, alpha=0.5)

  1. Is there a way to use a different colors for categorical values in high level charts? Like “Scatter” and “Bar” ?

Like when I did:

p1 = Scatter(DayOfWeek, x=‘Number of Posts’, y=‘Total Clicks’, color=‘Day of the week (EST)’, legend=‘top_left’)

I have 7 different colors but this default uses 2 same colors. How can I use something like “spectral16” for that?

  1. When I am drawing scattermap plots, is there a way to draw ‘lm’ regression model lines on top of the scattermap? It works fine in seaborn but converting it to bokeh removes the points itself :frowning:

It works fine in seaborn: ax = sns.regplot(x=‘Average Number of Clicks’, y=‘Average Number of Impressions’, data=hours)

Hi,

Hi,
Please excuse me if I missed something, since I have started using bokeh recently, but for some reason I am having issues:

  1. This works:

Scatter(sectionHour, x=‘Section+Hour of the day (EST)’, y=‘Number of Posts’)

but this does not:

s1 = figure(title=“Posts with clicks”, width=800, height=400)

s1.add_tools(HoverTool())

s1.circle(sectionHour[‘Section+Hour of the day (EST)’], sectionHour[‘Number of Posts’], size=7, color=“navy”, alpha=0.5)

The reason Scatter works “out of the box” while Figure doesn’t is because Scatter (as a High Level Chart) takes care of creating all the [categorical] ranges, glyphs and other internal details for you. Figure, on the other hand, let’s you do “whatever” you want but you also have to care about those lower level details… You should have more info also looking at the Plotting categorical example and the related section on the user guide for more details.

  1. Is there a way to use a different colors for categorical values in high level charts? Like “Scatter” and “Bar” ?

Like when I did:

p1 = Scatter(DayOfWeek, x=‘Number of Posts’, y=‘Total Clicks’, color=‘Day of the week (EST)’, legend=‘top_left’)

I have 7 different colors but this default uses 2 same colors. How can I use something like “spectral16” for that?

You can specify the palette argument to your chart to use another palette. Tthe charts palette example in the repo should be what you are looking for.

  1. When I am drawing scattermap plots, is there a way to draw ‘lm’ regression model lines on top of the scattermap? It works fine in seaborn but converting it to bokeh removes the points itself :frowning:

It works fine in seaborn: ax = sns.regplot(x=‘Average Number of Clicks’, y=‘Average Number of Impressions’, data=hours)

Are you using mpl from the compat interface for this? I’m not sure about this one. It could be a bug… Could you provide a piece of code that we can run to reproduce the issue?

Thanks

Fabio

···

On Tuesday, March 1, 2016 at 11:01:11 PM UTC-6, Mudit Uppal wrote: