In [1]:
from bokeh.plotting import figure
from bokeh.io import output_notebook, show
import numpy as np

output_notebook()
Loading BokehJS ...
In [2]:
xs = [1.,2,3,4,5]
ys = [1.,2,3,4,5]

colors = ['blue'] * len(xs)
colors[1] = 'red'
In [3]:
p1 =figure(height=300, width=300)

r = p1.rect(xs, ys, color=colors, width=.25, height=.25)

show(p1)
In [4]:
r.data_source.data
Out[4]:
{'fill_color': ['blue', 'red', 'blue', 'blue', 'blue'],
 'line_color': ['blue', 'red', 'blue', 'blue', 'blue'],
 'x': [1.0, 2, 3, 4, 5],
 'y': [1.0, 2, 3, 4, 5]}
In [5]:
r.data_source.data['fill_color'][2] = 'green'
In [6]:
show(p1)
In [ ]: