Bokeh Categorical Data | Blank Plot

Hello,

Apologies for the back to back questions.

I have replicated ’Mean MPG by # Cylinders and Manufacturer’ graph in the Bokeh categorical documentation: Handling categorical data — Bokeh 2.4.2 Documentation but for some reason, it’s returning a blank plot.

The example in the documentation works perfectly on my machine, but not when I use my own data which is in an identical format

My Data: variable stored as = new_df

Month_Number
Impressions
Link_Clicks
Registrations
Month
Audience
January
Pregancy
1
244180
1345
54
Page_1
1
503232
1485
670
LAL_3%
1
2013777
4976
476
LAL_10%
1
691157
2455
158
Homepage
1
1297993
2249
433
Core
1
741695
3510
185
February
Pregancy
2
224016
907
31
LAL_10%
2
565112
1751
97
LAL_3%
2
1887932
2861
255
Core
2
609653
2708
92
Homepage
2
1041295
1571
244
Page_1
2
469476
1064
418

**My Code: **

source_5 = ColumnDataSource(new_df)

index_cmap = factor_cmap(‘Month_Audience’, palette=viridis(12), factors=sorted(df[“Month”].unique()), end=1)

p5 = figure(plot_width=900, plot_height=350, x_range=new_df, title=“Impressions By Audience”, toolbar_location=None, tools="")

p5.vbar(x=‘Month_Audience’, top=‘Impressions’, width=1, source=source_5, line_color=“white”, fill_color=index_cmap)

p5.y_range.start = 0
p5.x_range.range_padding = 0.05
p5.xgrid.grid_line_color = None
p5.xaxis.axis_label = “Impressions By Audience”
p5.xaxis.major_label_orientation = math.pi/2
p5.outline_line_color = None

p5.add_tools(HoverTool(tooltips=[(“Impressions”, “@Impressions”), (“Month, Audience”, “@Month_Audience”)]))

show(p5)

``

Returns a blank plot.

Am I missing something?

Hi,

Are there any errors reported in the browsers' JavaScript console?

Thanks,

Bryan

···

On May 24, 2018, at 00:59, Adrian Ciconte <[email protected]> wrote:

Hello,

Apologies for the back to back questions.

I have replicated 'Mean MPG by # Cylinders and Manufacturer' graph in the Bokeh categorical documentation: http://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html but for some reason, it's returning a blank plot.

The example in the documentation works perfectly on my machine, but not when I use my own data which is in an identical format

My Data: variable stored as = new_df

Month_Number Impressions Link_Clicks Registrations
Month Audience
January Pregancy 1 244180 1345 54
Page_1 1 503232 1485 670
LAL_3% 1 2013777 4976 476
LAL_10% 1 691157 2455 158
Homepage 1 1297993 2249 433
Core 1 741695 3510 185
February Pregancy 2 224016 907 31
LAL_10% 2 565112 1751 97
LAL_3% 2 1887932 2861 255
Core 2 609653 2708 92
Homepage 2 1041295 1571 244
Page_1 2 469476 1064 418

My Code:

source_5 = ColumnDataSource(new_df)

index_cmap = factor_cmap('Month_Audience', palette=viridis(12), factors=sorted(df["Month"].unique()), end=1)

p5 = figure(plot_width=900, plot_height=350, x_range=new_df, title="Impressions By Audience", toolbar_location=None, tools="")

p5.vbar(x='Month_Audience', top='Impressions', width=1, source=source_5, line_color="white", fill_color=index_cmap)

p5.y_range.start = 0
p5.x_range.range_padding = 0.05
p5.xgrid.grid_line_color = None
p5.xaxis.axis_label = "Impressions By Audience"
p5.xaxis.major_label_orientation = math.pi/2
p5.outline_line_color = None

p5.add_tools(HoverTool(tooltips=[("Impressions", "@Impressions"), ("Month, Audience", "@Month_Audience")]))

show(p5)

Returns a blank plot.

Am I missing something?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8496b531-a202-4700-a436-11bbcd1903b8%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

Thanks for getting back to me - I really appreciate it.

No, there are no errors. Just a blank plot.

Have you been able to replicate it?

Kind regards,

Adrian

···

On Saturday, May 26, 2018 at 7:07:55 AM UTC+10, Bryan Van de ven wrote:

Hi,

Are there any errors reported in the browsers’ JavaScript console?

Thanks,

Bryan

On May 24, 2018, at 00:59, Adrian Ciconte [email protected] wrote:

Hello,

Apologies for the back to back questions.

I have replicated ‘Mean MPG by # Cylinders and Manufacturer’ graph in the Bokeh categorical documentation: http://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html but for some reason, it’s returning a blank plot.

The example in the documentation works perfectly on my machine, but not when I use my own data which is in an identical format

My Data: variable stored as = new_df

Month_Number Impressions Link_Clicks Registrations

Month Audience

January Pregancy 1 244180 1345 54

Page_1 1 503232 1485 670

LAL_3% 1 2013777 4976 476

LAL_10% 1 691157 2455 158

Homepage 1 1297993 2249 433

Core 1 741695 3510 185

February Pregancy 2 224016 907 31

LAL_10% 2 565112 1751 97

LAL_3% 2 1887932 2861 255

Core 2 609653 2708 92

Homepage 2 1041295 1571 244

Page_1 2 469476 1064 418

My Code:

source_5 = ColumnDataSource(new_df)

index_cmap = factor_cmap(‘Month_Audience’, palette=viridis(12), factors=sorted(df[“Month”].unique()), end=1)

p5 = figure(plot_width=900, plot_height=350, x_range=new_df, title=“Impressions By Audience”, toolbar_location=None, tools=“”)

p5.vbar(x=‘Month_Audience’, top=‘Impressions’, width=1, source=source_5, line_color=“white”, fill_color=index_cmap)

p5.y_range.start = 0

p5.x_range.range_padding = 0.05

p5.xgrid.grid_line_color = None

p5.xaxis.axis_label = “Impressions By Audience”

p5.xaxis.major_label_orientation = math.pi/2

p5.outline_line_color = None

p5.add_tools(HoverTool(tooltips=[(“Impressions”, “@Impressions”), (“Month, Audience”, “@Month_Audience”)]))

show(p5)

Returns a blank plot.

Am I missing something?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8496b531-a202-4700-a436-11bbcd1903b8%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

No, can you provide a complete self contained script for me to run? Multiplied across questions from all users, adding missing imports and preparing data adds up to a large burden. I’m happy to try out a complete script that does not require and additions or modification, though.

Thanks,

Bryan

···

On May 25, 2018, at 21:31, Adrian Ciconte [email protected] wrote:

Hi Bryan,

Thanks for getting back to me - I really appreciate it.

No, there are no errors. Just a blank plot.

Have you been able to replicate it?

Kind regards,

Adrian

On Saturday, May 26, 2018 at 7:07:55 AM UTC+10, Bryan Van de ven wrote:

Hi,

Are there any errors reported in the browsers’ JavaScript console?

Thanks,

Bryan

On May 24, 2018, at 00:59, Adrian Ciconte [email protected] wrote:

Hello,

Apologies for the back to back questions.

I have replicated ‘Mean MPG by # Cylinders and Manufacturer’ graph in the Bokeh categorical documentation: http://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html but for some reason, it’s returning a blank plot.

The example in the documentation works perfectly on my machine, but not when I use my own data which is in an identical format

My Data: variable stored as = new_df

Month_Number Impressions Link_Clicks Registrations

Month Audience

January Pregancy 1 244180 1345 54

Page_1 1 503232 1485 670

LAL_3% 1 2013777 4976 476

LAL_10% 1 691157 2455 158

Homepage 1 1297993 2249 433

Core 1 741695 3510 185

February Pregancy 2 224016 907 31

LAL_10% 2 565112 1751 97

LAL_3% 2 1887932 2861 255

Core 2 609653 2708 92

Homepage 2 1041295 1571 244

Page_1 2 469476 1064 418

My Code:

source_5 = ColumnDataSource(new_df)

index_cmap = factor_cmap(‘Month_Audience’, palette=viridis(12), factors=sorted(df[“Month”].unique()), end=1)

p5 = figure(plot_width=900, plot_height=350, x_range=new_df, title=“Impressions By Audience”, toolbar_location=None, tools=“”)

p5.vbar(x=‘Month_Audience’, top=‘Impressions’, width=1, source=source_5, line_color=“white”, fill_color=index_cmap)

p5.y_range.start = 0

p5.x_range.range_padding = 0.05

p5.xgrid.grid_line_color = None

p5.xaxis.axis_label = “Impressions By Audience”

p5.xaxis.major_label_orientation = math.pi/2

p5.outline_line_color = None

p5.add_tools(HoverTool(tooltips=[(“Impressions”, “@Impressions”), (“Month, Audience”, “@Month_Audience”)]))

show(p5)

Returns a blank plot.

Am I missing something?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8496b531-a202-4700-a436-11bbcd1903b8%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2680e6a1-1b4c-4c89-ab0b-42d2edea1afb%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan,

If you run that script on the Data_Frame above, it will show you my problem. You don’t need to re-write anything. I have run this exact script on the Cars Dataset and it works perfectly. I just don’t know why it doesn’t work on mine.

Totally cool if you don’t have time for this (I know you get a lot of questions so I appreciate you making the time to get back to me) - there is no time urgency on my end. I just want to start building dashboards for my organisation using Bokeh but want to ensure I can troubleshoot the basics before deploying.

Using BokehJS 0.12.16.

Thanks again,

Adrian

···

On Saturday, May 26, 2018 at 4:07:05 PM UTC+10, Bryan Van de ven wrote:

Hi,

No, can you provide a complete self contained script for me to run? Multiplied across questions from all users, adding missing imports and preparing data adds up to a large burden. I’m happy to try out a complete script that does not require and additions or modification, though.

Thanks,

Bryan

On May 25, 2018, at 21:31, Adrian Ciconte [email protected] wrote:

Hi Bryan,

Thanks for getting back to me - I really appreciate it.

No, there are no errors. Just a blank plot.

Have you been able to replicate it?

Kind regards,

Adrian

On Saturday, May 26, 2018 at 7:07:55 AM UTC+10, Bryan Van de ven wrote:

Hi,

Are there any errors reported in the browsers’ JavaScript console?

Thanks,

Bryan

On May 24, 2018, at 00:59, Adrian Ciconte [email protected] wrote:

Hello,

Apologies for the back to back questions.

I have replicated ‘Mean MPG by # Cylinders and Manufacturer’ graph in the Bokeh categorical documentation: http://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html but for some reason, it’s returning a blank plot.

The example in the documentation works perfectly on my machine, but not when I use my own data which is in an identical format

My Data: variable stored as = new_df

Month_Number Impressions Link_Clicks Registrations

Month Audience

January Pregancy 1 244180 1345 54

Page_1 1 503232 1485 670

LAL_3% 1 2013777 4976 476

LAL_10% 1 691157 2455 158

Homepage 1 1297993 2249 433

Core 1 741695 3510 185

February Pregancy 2 224016 907 31

LAL_10% 2 565112 1751 97

LAL_3% 2 1887932 2861 255

Core 2 609653 2708 92

Homepage 2 1041295 1571 244

Page_1 2 469476 1064 418

My Code:

source_5 = ColumnDataSource(new_df)

index_cmap = factor_cmap(‘Month_Audience’, palette=viridis(12), factors=sorted(df[“Month”].unique()), end=1)

p5 = figure(plot_width=900, plot_height=350, x_range=new_df, title=“Impressions By Audience”, toolbar_location=None, tools=“”)

p5.vbar(x=‘Month_Audience’, top=‘Impressions’, width=1, source=source_5, line_color=“white”, fill_color=index_cmap)

p5.y_range.start = 0

p5.x_range.range_padding = 0.05

p5.xgrid.grid_line_color = None

p5.xaxis.axis_label = “Impressions By Audience”

p5.xaxis.major_label_orientation = math.pi/2

p5.outline_line_color = None

p5.add_tools(HoverTool(tooltips=[(“Impressions”, “@Impressions”), (“Month, Audience”, “@Month_Audience”)]))

show(p5)

Returns a blank plot.

Am I missing something?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8496b531-a202-4700-a436-11bbcd1903b8%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2680e6a1-1b4c-4c89-ab0b-42d2edea1afb%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

I’d like to help. I’m looking for something I can copy directly into an editor with zero modifications, save, and run.

Thanks,

Bryan

···

On May 25, 2018, at 23:15, Adrian Ciconte [email protected] wrote:

Hi Bryan,

If you run that script on the Data_Frame above, it will show you my problem. You don’t need to re-write anything. I have run this exact script on the Cars Dataset and it works perfectly. I just don’t know why it doesn’t work on mine.

Totally cool if you don’t have time for this (I know you get a lot of questions so I appreciate you making the time to get back to me) - there is no time urgency on my end. I just want to start building dashboards for my organisation using Bokeh but want to ensure I can troubleshoot the basics before deploying.

Using BokehJS 0.12.16.

Thanks again,

Adrian

On Saturday, May 26, 2018 at 4:07:05 PM UTC+10, Bryan Van de ven wrote:

Hi,

No, can you provide a complete self contained script for me to run? Multiplied across questions from all users, adding missing imports and preparing data adds up to a large burden. I’m happy to try out a complete script that does not require and additions or modification, though.

Thanks,

Bryan

On May 25, 2018, at 21:31, Adrian Ciconte [email protected] wrote:

Hi Bryan,

Thanks for getting back to me - I really appreciate it.

No, there are no errors. Just a blank plot.

Have you been able to replicate it?

Kind regards,

Adrian

On Saturday, May 26, 2018 at 7:07:55 AM UTC+10, Bryan Van de ven wrote:

Hi,

Are there any errors reported in the browsers’ JavaScript console?

Thanks,

Bryan

On May 24, 2018, at 00:59, Adrian Ciconte [email protected] wrote:

Hello,

Apologies for the back to back questions.

I have replicated ‘Mean MPG by # Cylinders and Manufacturer’ graph in the Bokeh categorical documentation: http://bokeh.pydata.org/en/latest/docs/user_guide/categorical.html but for some reason, it’s returning a blank plot.

The example in the documentation works perfectly on my machine, but not when I use my own data which is in an identical format

My Data: variable stored as = new_df

Month_Number Impressions Link_Clicks Registrations

Month Audience

January Pregancy 1 244180 1345 54

Page_1 1 503232 1485 670

LAL_3% 1 2013777 4976 476

LAL_10% 1 691157 2455 158

Homepage 1 1297993 2249 433

Core 1 741695 3510 185

February Pregancy 2 224016 907 31

LAL_10% 2 565112 1751 97

LAL_3% 2 1887932 2861 255

Core 2 609653 2708 92

Homepage 2 1041295 1571 244

Page_1 2 469476 1064 418

My Code:

source_5 = ColumnDataSource(new_df)

index_cmap = factor_cmap(‘Month_Audience’, palette=viridis(12), factors=sorted(df[“Month”].unique()), end=1)

p5 = figure(plot_width=900, plot_height=350, x_range=new_df, title=“Impressions By Audience”, toolbar_location=None, tools=“”)

p5.vbar(x=‘Month_Audience’, top=‘Impressions’, width=1, source=source_5, line_color=“white”, fill_color=index_cmap)

p5.y_range.start = 0

p5.x_range.range_padding = 0.05

p5.xgrid.grid_line_color = None

p5.xaxis.axis_label = “Impressions By Audience”

p5.xaxis.major_label_orientation = math.pi/2

p5.outline_line_color = None

p5.add_tools(HoverTool(tooltips=[(“Impressions”, “@Impressions”), (“Month, Audience”, “@Month_Audience”)]))

show(p5)

Returns a blank plot.

Am I missing something?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/8496b531-a202-4700-a436-11bbcd1903b8%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2680e6a1-1b4c-4c89-ab0b-42d2edea1afb%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7f0a1b9c-f317-4bba-a1a5-fba9f07c70e7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.