In [15]:
import bokeh
bokeh.print_versions()


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Bokeh version: 0.4.4
Python version: 2.7.5+ (default, Feb 27 2014, 19:37:08) 
[GCC 4.8.1]
Platform: Linux-3.11.0-20-generic-x86_64 (#34-Ubuntu SMP Tue Apr 1 20:40:25 UTC 2014)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

In [8]:
from bokeh.plotting import *
from bokeh.objects import HoverTool
from collections import OrderedDict

In [9]:
output_notebook()


Bokeh Plot

Configuring embedded BokehJS mode.


In [10]:
#5 datasets (rows)
#8 buckets (columns)

buckets = ['AMOUNT', 'BUYER', 'TENDER TRACKING', 'TENDER FEATURES', 'AWARD TRACKING', 'AWARD FEATURES', 'SYSTEM', 'SUPPLIER']
datasets = ['Canada', 'Turkey', 'France', 'UK', 'Moldova']
data = [
('Canada', [1, 2, 1, 2, 1, 2, 1, 2]),
('Turkey', [2, 2, 2, 2, 0, 0, 1, 1]),
('France', [3, 2, 1, 3, 2, 1, 3, 2]),
('UK', [1, 1, 1, 0, 0, 0, 0, 1]),
('Moldova', [2, 3, 4, 1, 1, 2, 6, 9]),
]

In [11]:
x = []
y = []
radii = []
for i in xrange(len(datasets)):
    for j in xrange(len(buckets)):
        dataset = datasets[i]
        bucket = buckets[j]
        x.append(dataset)
        y.append(bucket)
        radii.append(data[i][1][j]*10)

In [12]:
source = ColumnDataSource(
    data=dict(
        x=x,
        y=y,
        radii=radii,
    )
)

In [13]:
hold()

In [14]:
# draw it
figure()

plot_properties = {

    'plot_height': 800,
    'plot_width':1000,
    'title': None,
    'tools': "hover",
    'x_range': datasets, 
    'y_range': buckets,
}

rect(x, y, 0.5, 0.5,
     source=source,
     color='white', # put in background
     **plot_properties)

circle('x', 'y', 
       source=source,
       size='radii', 
       color='black',
       **plot_properties)

grid().grid_line_color = None

hover = [t for t in curplot().tools if isinstance(t, HoverTool)][0]

hover.tooltips = OrderedDict([
    ("Fields", "@radii"),
])

show()


Bokeh Plot
Plots

In [14]: