mark example cells in dataoverview
This commit is contained in:
@@ -10,8 +10,16 @@ from plotstyle import plot_style, lighter, significance_str
|
||||
data_path = Path('data')
|
||||
|
||||
|
||||
punit_example = [['2020-10-27-ag-invivo-1', 0],
|
||||
['2020-10-27-ag-invivo-1', 1]]
|
||||
ampul_example = [['2012-05-15-ac', 3],
|
||||
['2012-05-15-ac', 1]]
|
||||
from punitexamplecell import example_cells as punit_examples
|
||||
from ampullaryexamplecell import example_cells as ampul_examples
|
||||
|
||||
|
||||
def plot_corr(ax, data, xcol, ycol, zcol, zmin, zmax, xpdfmax, cmap, color,
|
||||
nli_thresh):
|
||||
nli_thresh, example=[], examples=[]):
|
||||
ax.axhline(nli_thresh, color='k', ls=':', lw=0.5)
|
||||
"""
|
||||
for c in np.unique(data('cell')):
|
||||
@@ -26,7 +34,21 @@ def plot_corr(ax, data, xcol, ycol, zcol, zmin, zmax, xpdfmax, cmap, color,
|
||||
ymax = ax.get_ylim()[1]
|
||||
mask = (data(xcol) < xmax) & (data(ycol) < ymax)
|
||||
sc = ax.scatter(data[mask, xcol], data[mask, ycol], c=data[mask, zcol],
|
||||
s=3, clip_on=False, cmap=cmap, vmin=zmin, vmax=zmax, zorder=20)
|
||||
s=4, marker='o', linewidth=0, edgecolors='none',
|
||||
clip_on=False, cmap=cmap, vmin=zmin, vmax=zmax, zorder=20)
|
||||
if 'stimindex' in data:
|
||||
for cell, run in example:
|
||||
mask = (data('cell') == cell) & (data('stimindex') == run)
|
||||
ax.scatter(data[mask, xcol], data[mask, ycol], c=data[mask, zcol],
|
||||
s=6, marker='^', linewidth=0.5, edgecolors='black',
|
||||
clip_on=False, cmap=cmap, vmin=zmin, vmax=zmax,
|
||||
zorder=20)
|
||||
for cell, run in examples:
|
||||
mask = (data('cell') == cell) & (data('stimindex') == run)
|
||||
ax.scatter(data[mask, xcol], data[mask, ycol], c=data[mask, zcol],
|
||||
s=5, marker='o', linewidth=0.5, edgecolors='black',
|
||||
clip_on=False, cmap=cmap, vmin=zmin, vmax=zmax,
|
||||
zorder=20)
|
||||
# color bar:
|
||||
fig = ax.get_figure()
|
||||
cax = ax.inset_axes([1.3, 0, 0.04, 1])
|
||||
@@ -91,10 +113,11 @@ def plot_cvbase_nli_punit(ax, data, ycol, nli_thresh, color):
|
||||
ax.set_xlabel('CV$_{\\rm base}$')
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_xlim(0, 1.5)
|
||||
ax.set_ylim(0, 6)
|
||||
ax.set_ylim(0, 7.2)
|
||||
ax.set_yticks_delta(2)
|
||||
cax = plot_corr(ax, data, 'cvbase', ycol, 'respmod2', 0, 250, 3,
|
||||
'coolwarm', color, nli_thresh)
|
||||
'coolwarm', color, nli_thresh,
|
||||
punit_example, punit_examples)
|
||||
cax.set_ylabel('Response mod.', 'Hz')
|
||||
|
||||
|
||||
@@ -102,17 +125,20 @@ def plot_cvstim_nli_punit(ax, data, ycol, nli_thresh, color):
|
||||
ax.set_xlabel('CV$_{\\rm stim}$')
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_xlim(0, 1.6)
|
||||
ax.set_ylim(0, 6)
|
||||
ax.set_ylim(0, 7.2)
|
||||
ax.set_xticks_delta(0.5)
|
||||
ax.set_yticks_delta(2)
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'respmod2', 0, 250, 2,
|
||||
# 'coolwarm', color, nli_thresh)
|
||||
# 'coolwarm', color, nli_thresh,
|
||||
# punit_example, punit_examples)
|
||||
#cax.set_ylabel('Response mod.', 'Hz')
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'cvbase', 0, 1.5, 2,
|
||||
# 'coolwarm', color, nli_thresh)
|
||||
# 'coolwarm', color, nli_thresh,
|
||||
# punit_example, punit_examples)
|
||||
#cax.set_ylabel('CV$_{\\rm base}$')
|
||||
cax = plot_corr(ax, data, 'cvstim', ycol, 'ratebase', 50, 450, 2,
|
||||
'coolwarm', color, nli_thresh)
|
||||
'coolwarm', color, nli_thresh,
|
||||
punit_example, punit_examples)
|
||||
cax.set_ylabel('$r$', 'Hz')
|
||||
|
||||
|
||||
@@ -120,10 +146,11 @@ def plot_mod_nli_punit(ax, data, ycol, nli_thresh, color):
|
||||
ax.set_xlabel('Response modulation', 'Hz')
|
||||
ax.set_ylabel('SI($r$)')
|
||||
ax.set_xlim(0, 250)
|
||||
ax.set_ylim(0, 6)
|
||||
ax.set_ylim(0, 7.2)
|
||||
ax.set_yticks_delta(2)
|
||||
cax = plot_corr(ax, data, 'respmod2', ycol, 'cvbase', 0, 1.5, 0.016,
|
||||
'coolwarm', color, nli_thresh)
|
||||
'coolwarm', color, nli_thresh,
|
||||
punit_example, punit_examples)
|
||||
cax.set_ylabel('CV$_{\\rm base}$')
|
||||
|
||||
|
||||
@@ -135,7 +162,8 @@ def plot_cvbase_nli_ampul(ax, data, ycol, nli_thresh, color):
|
||||
ax.set_xticks_delta(0.1)
|
||||
ax.set_yticks_delta(5)
|
||||
cax = plot_corr(ax, data, 'cvbase', ycol, 'respmod2', 0, 80, 20,
|
||||
'coolwarm', color, nli_thresh)
|
||||
'coolwarm', color, nli_thresh,
|
||||
ampul_example, ampul_examples)
|
||||
cax.set_ylabel('Response mod.', 'Hz')
|
||||
|
||||
|
||||
@@ -147,14 +175,17 @@ def plot_cvstim_nli_ampul(ax, data, ycol, nli_thresh, color):
|
||||
ax.set_xticks_delta(0.2)
|
||||
ax.set_yticks_delta(5)
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'respmod2', 0, 80, 6,
|
||||
# 'coolwarm', color, nli_thresh)
|
||||
# 'coolwarm', color, nli_thresh,
|
||||
# ampul_example, ampul_examples)
|
||||
#cax.set_ylabel('Response mod.', 'Hz')
|
||||
#cax = plot_corr(ax, data, 'cvstim', ycol, 'cvbase', 0, 0.2, 6,
|
||||
# 'coolwarm', color, nli_thresh)
|
||||
# 'coolwarm', color, nli_thresh,
|
||||
# ampul_example, ampul_examples)
|
||||
#cax.set_ylabel('CV$_{\\rm base}$')
|
||||
#cax.set_yticks_delta(0.1)
|
||||
cax = plot_corr(ax, data, 'cvstim', ycol, 'ratebase', 90, 180, 6,
|
||||
'coolwarm', color, nli_thresh)
|
||||
'coolwarm', color, nli_thresh,
|
||||
ampul_example, ampul_examples)
|
||||
cax.set_ylabel('$r$', 'Hz')
|
||||
cax.set_yticks_delta(30)
|
||||
|
||||
@@ -167,7 +198,8 @@ def plot_mod_nli_ampul(ax, data, ycol, nli_thresh, color):
|
||||
ax.set_xticks_delta(20)
|
||||
ax.set_yticks_delta(5)
|
||||
cax = plot_corr(ax, data, 'respmod2', ycol, 'cvbase', 0, 0.2, 0.06,
|
||||
'coolwarm', color, nli_thresh)
|
||||
'coolwarm', color, nli_thresh,
|
||||
ampul_example, ampul_examples)
|
||||
cax.set_ylabel('CV$_{\\rm base}$')
|
||||
cax.set_yticks_delta(0.1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user