In [1]:
%load_ext autoreload
%autoreload 2
import pandas as pd
import bebi103
import bokeh.io
bokeh.io.output_notebook()
In [2]:
df = pd.read_csv('frog_tongue_adhesion.csv', comment='#')
data_dict = {'ID': ['I', 'II', 'III', 'IV'],
'age': ['adult', 'adult', 'juvenile', 'juvenile'],
'SVL (mm)': [63, 70, 28, 31],
'weight (g)': [63.1, 72.7, 12.7, 12.7],
'species': ['cross', 'cross', 'cranwelli', 'cranwelli']}
df = df.merge(pd.DataFrame(data=data_dict))
In [3]:
p = bebi103.viz.jitter( data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=False,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=False,
color_column=None,
tooltips=None)
bokeh.io.show(p)
In [4]:
p = bebi103.viz.jitter( data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=False,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=False,
color_column='age',
tooltips=None)
bokeh.io.show(p)
In [5]:
p = bebi103.viz.jitter( data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=False,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=True,
color_column=None,
tooltips=None)
bokeh.io.show(p)
In [6]:
p = bebi103.viz.jitter( data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=False,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=True,
color_column='trial number',
tooltips=None)
bokeh.io.show(p)
In [7]:
p = bebi103.viz.jitter( data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=True,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=False,
color_column=None,
tooltips=[('impact force (mN)', '@{impact force (mN)}'),
('trial number', '@{trial number}'),
('adhesive force (mN)', '@{adhesive force (mN)}')])
bokeh.io.show(p)
In [8]:
p = bebi103.viz.jitter( data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=True,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='log',
show_legend=False,
color_column=None,
tooltips=[('impact force (mN)', '@{impact force (mN)}'),
('trial number', '@{trial number}'),
('adhesive force (mN)', '@{adhesive force (mN)}')])
bokeh.io.show(p)
In [9]:
p = bebi103.viz.jitter( data=df,
cats=['age', 'ID'],
val='impact force (mN)',
p=None,
horizontal=False,
x_axis_label='ID',
y_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=False,
color_column=None,
tooltips=None)
bokeh.io.show(p)
In [10]:
p = bebi103.viz.jitter( data=df,
cats=['age', 'ID'],
val='impact force (mN)',
p=None,
horizontal=True,
y_axis_label=None,
x_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear',
show_legend=False,
color_column='trial number',
tooltips=None)
bokeh.io.show(p)
In [11]:
p = bebi103.viz.ecdf_collection(data=df,
cats='ID',
val='impact force (mN)',
p=None,
x_axis_label='impact force (mN)',
y_axis_label=None,
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
order=['I', 'III', 'IV', 'II'],
val_axis_type='linear',
show_legend=True,
tooltips=[('impact force (mN)', '@{impact force (mN)}'),
('trial number', '@{trial number}'),
('adhesive force (mN)', '@{adhesive force (mN)}')])
bokeh.io.show(p)
In [12]:
p = bebi103.viz.ecdf_collection(data=df,
cats='ID',
val='impact force (mN)',
p=None,
formal=True,
x_axis_label='impact force (mN)',
y_axis_label=None,
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
order=['I', 'III', 'IV', 'II'],
val_axis_type='linear',
show_legend=True,
tooltips=[('impact force (mN)', '@{impact force (mN)}'),
('trial number', '@{trial number}'),
('adhesive force (mN)', '@{adhesive force (mN)}')])
bokeh.io.show(p)
In [14]:
p = bebi103.viz.colored_ecdf(data=df,
cats='ID',
val='impact force (mN)',
p=None,
x_axis_label='impact force (mN)',
y_axis_label=None,
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
order=['I', 'III', 'IV', 'II'],
val_axis_type='linear',
show_legend=True,
tooltips=[('impact force (mN)', '@{impact force (mN)}'),
('trial number', '@{trial number}'),
('adhesive force (mN)', '@{adhesive force (mN)}')])
bokeh.io.show(p)
In [60]:
p = bebi103.viz.box(data=df,
cats='ID',
val='impact force (mN)',
p=None,
horizontal=True,
y_axis_label='ID',
x_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='log')
bokeh.io.show(p)
In [63]:
p = bebi103.viz.box(data=df,
cats=['age', 'ID'],
val='impact force (mN)',
p=None,
horizontal=True,
y_axis_label='ID',
x_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear')
bokeh.io.show(p)
In [64]:
p = bebi103.viz.box(data=df,
cats=['age', 'ID', 'SVL (mm)'],
val='impact force (mN)',
p=None,
horizontal=True,
y_axis_label='ID',
x_axis_label='impact force (mN)',
title=None,
plot_height=300,
plot_width=400,
palette=['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f',
'#edc948', '#b07aa1', '#ff9da7', '#9c755f', '#bab0ac'],
width=0.4,
order=None,
val_axis_type='linear')
bokeh.io.show(p)