In [1]:
from pathlib import Path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format='retina' # for hi-dpi displays
%matplotlib inline
In [2]:
sns.set(font_scale=1.3)
sns.set_style('whitegrid')
colors = np.array(sns.color_palette("Set1", 9))[(1,0,2,3,4,8,6,7), :]
sns.set_palette(colors, 8)
In [3]:
save_figures = True
def savefig(filename, **kwargs):
if not save_figures:
return
import os
dir_ = 'figures/'
kwargs_ = dict(dpi=300, bbox_inches='tight')
#frameon=True, facecolor='white', transparent=False)
kwargs_.update(kwargs)
plt.savefig(dir_ + filename, **kwargs_)
print('Saved: %s' % (dir_ + filename))
In [4]:
fs = [f for f in Path('results').glob('singlespot_*_histfit_*window30s*')]
[f.stem for f in fs]
Out[4]:
In [5]:
df_alex = pd.read_csv(fs[0], index_col=0)
df_alex.head()
Out[5]:
In [6]:
fm = [f for f in Path('results').glob('multispot_*_histfit_*window30s*')]
[f.stem for f in fm]
Out[6]:
In [7]:
df_mspot = pd.read_csv(fm[1], index_col=0)
df_mspot.index.name = 'Time (s)'
df_mspot.head()
Out[7]:
In [8]:
fig, ax = plt.subplots(figsize=(7, 5))
sty = dict(lw=0)
df_mspot.kinetics[::10].plot(ms=8, marker='o', zorder=2)
df_alex.kinetics.plot(ms=7, marker='s', zorder=1)
plt.ylabel('Run-off fraction')
plt.title('Multi-spot vs single-spot kinetics')
plt.xlim(-200, 600)
plt.legend(['Multispot', 'μs-ALEX'])
savefig('Multi-spot vs single-spot kinetics.png')
In [ ]: