In [ ]:
import numpy as np
import pandas as pd
from IPython.core.display import HTML

import bokeh
print('Bokeh version:', bokeh.__version__)

#from bokeh.plotting import figure, show
#from bokeh.io import output_notebook
#from bokeh.models import HoverTool
#from bokeh.resources import CDN
#from bokeh.embed import file_html
#output_notebook()

#df = pd.read_csv('stress_strain_data.csv', sep=',', header=None, skiprows=0)
#myplot = figure(plot_width=600, plot_height=400)
#myplot.circle('x', 'y', size=7, fill_alpha=0.5, source=df)
#show(myplot, notebook_handle=True);

In [ ]:
df = pd.read_csv('stress_strain_data.csv', sep=',', header=None, skiprows=0)
df.columns = ['strain', 'stress']
df.head()

Plot with holoviews and bokeh


In [ ]:
import holoviews as hv
hv.extension('bokeh')
import bokeh
print('holovies version: ', hv.__version__)
print('bokeh version, ', bokeh.__version__)

In [ ]:
hv.archive.auto()
scatter = hv.Curve(df, 'strain', 'stress')
scatter

In [ ]:
type(scatter)

In [ ]:
hv.archive.export()

In [ ]:
from IPython.core.display import HTML
HTML('/home/tribilium/Documents/staticsite/content/code/tensiletest/indx.html')

In [ ]:
from bokeh.plotting import figure, output_file, show
from bokeh.models import ColumnDataSource, CDSView, IndexFilter
from bokeh.layouts import gridplot

output_file("index_filter.html")

source = ColumnDataSource(data=dict(x=[1, 2, 3, 4, 5], y=[1, 2, 3, 4, 5]))
view = CDSView(source=source, filters=[IndexFilter([0, 2, 4])])

tools = ["box_select", "hover", "reset"]
p = figure(plot_height=300, plot_width=300, tools=tools)
p.circle(x="x", y="y", size=10, hover_color="red", source=source)

p_filtered = figure(plot_height=300, plot_width=300, tools=tools)
p_filtered.circle(x="x", y="y", size=10, hover_color="red", source=source, view=view)

show(gridplot([[p, p_filtered]]))

In [ ]:
from IPython.core.display import HTML
HTML('index_filter.html')

In [ ]: