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?