Skip to content

Instantly share code, notes, and snippets.

@AntonioMarsella
Created March 19, 2020 14:11
Show Gist options
  • Save AntonioMarsella/fb290f2fee8bf7b352c1c370a6e9bfc3 to your computer and use it in GitHub Desktop.
Save AntonioMarsella/fb290f2fee8bf7b352c1c370a6e9bfc3 to your computer and use it in GitHub Desktop.
bokeh color mapping
from bokeh.models import CategoricalColorMapper
mapper = CategoricalColorMapper(factors=['setosa', 'virginica', 'versicolor], palette=['red', 'green', 'blue'])
plot = figure(x_axis_label='petal_length', y_axis_label='sepal_length')
plot.circle('petal_length', 'sepal_length', size=10, source=source, color={'field': 'species', 'transform': mapper}=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment