

timetuple ()) * 1000 daylight_savings_start = Span ( location = start_date, dimension = 'height', line_color = '#009E73', line_dash = 'dashed', line_width = 3 ) p. Sunrise, line_color = '#0072B2', line_dash = 'dotted', line_width = 2, legend_label = "Sunrise" ) start_date = time. Sunset, line_color = '#0072B2', line_dash = 'solid', line_width = 2, legend_label = "Sunset" ) p. Import time from datetime import datetime as dt from bokeh.models import Span from otting import figure, output_file, show from import daylight_warsaw_2013 output_file ( "span.html", title = "span.py example" ) p = figure ( x_axis_type = "datetime", y_axis_type = "datetime" ) p. ', render_mode = 'css', border_line_color = 'black', border_line_alpha = 1.0, background_fill_color = 'white', background_fill_alpha = 1.0 ) p. axis_label = 'Height (in)' labels = LabelSet ( x = 'weight', y = 'height', text = 'names', x_offset = 5, y_offset = 5, source = source, render_mode = 'canvas' ) citation = Label ( x = 70, y = 70, x_units = 'screen', y_units = 'screen', text = 'Collected by Luke C. scatter ( x = 'weight', y = 'height', size = 8, source = source ) p.

of 10th Grade Students at Lee High', x_range = Range1d ( 140, 275 )) p.

add_layout ( polygon ) show ( p )įrom bokeh.models import ColumnDataSource, Label, LabelSet, Range1d from otting import figure, output_file, show output_file ( "label.html", title = "label.py example" ) source = ColumnDataSource ( data = dict ( height =, weight =, names = )) p = figure ( title = 'Dist.

values polygon = PolyAnnotation ( fill_color = "blue", fill_alpha = 0.3, xs =, ys =, ) p. values end_date = dt ( 2010, 1, 4 ) end_float = end_date. line ( df, df, line_width = 2, color = "red" ) start_date = dt ( 2008, 11, 24 ) start_float = start_date. axis_label = 'Value' show ( p )įrom datetime import datetime as dt import pandas as pd from bokeh.models import PolyAnnotation from otting import figure, output_file, show from import GOOG output_file ( "polyannotation.html", title = "polannotation example" ) p = figure ( width = 800, height = 250, x_axis_type = "datetime", title = "Google stock", ) df = pd. to_series (), data, line_color = "gray", line_width = 1, legend_label = "glucose" ) low_box = BoxAnnotation ( top = 80, fill_alpha = 0.2, fill_color = '#D55E00' ) mid_box = BoxAnnotation ( bottom = 80, top = 180, fill_alpha = 0.2, fill_color = '#0072B2' ) high_box = BoxAnnotation ( bottom = 180, fill_alpha = 0.2, fill_color = '#D55E00' ) p. loc p = figure ( x_axis_type = "datetime", tools = TOOLS ) p. axis_label = 'Y' show ( p )įrom bokeh.models import BoxAnnotation from otting import figure, output_file, show from import data output_file ( "box_annotation.html", title = "box_annotation.py example" ) TOOLS = "pan,wheel_zoom,box_zoom,reset,save" #reduce data size data = data. scatter ( x = 'x', y = 'y', line_color = None, fill_alpha = 0.3, size = 5, source = source ) band = Band ( base = 'x', lower = 'lower', upper = 'upper', source = source, level = 'underlay', fill_alpha = 1.0, line_width = 1, line_color = 'black' ) p. reset_index ()) TOOLS = "pan,wheel_zoom,box_zoom,reset,save" p = figure ( tools = TOOLS ) p. sort_values ( by = "x" ) sem = lambda x : x. DataFrame ( data = dict ( x = x, y = y )). Import numpy as np import pandas as pd from bokeh.models import Band, ColumnDataSource from otting import figure, output_file, show output_file ( "band.html", title = "band.py example" ) # Create some random data x = np.
