Color points in scatter plot of Bokeh
问题 I have the following simple pandas.DataFrame : df = pd.DataFrame( { "journey": ['ch1', 'ch2', 'ch2', 'ch1'], "cat": ['a', 'b', 'a', 'c'], "kpi1": [1,2,3,4], "kpi2": [4,3,2,1] } ) Which I plot as follows: import bokeh.plotting as bpl import bokeh.models as bmo bpl.output_notebook() source = bpl.ColumnDataSource.from_df(df) hover = bmo.HoverTool( tooltips=[ ("index", "@index"), ('journey', '@journey'), ("Cat", '@cat') ] ) p = bpl.figure(tools=[hover]) p.scatter( 'kpi1', 'kpi2', source=source)