Classification of S-cones vs. M-cones


In [1]:
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
%matplotlib inline
matplotlib.rc('font',**{'family':'sans-serif','sans-serif':['Arial']})
matplotlib.rcParams.update({'mathtext.default': 'regular'})
matplotlib.rcParams.update({'font.size': 14})
sns.set_style("whitegrid")

In [2]:
CBC9_cone_class=np.array([[7,6,10,29,61,9,31,14,24,23,100,28,17,90],[1,1,0,1,0,1,0,0,1,0,0,1,0,0],[6,10,1,2,1,2,1,1,2,1,1,2,1,1],\
          [2,4,1,1,1,1,1,1,1,1,1,2,1,1],[2,4,2,1,2,1,2,1,2,2,2,3,3,1],[0.13,0.14,0.33,0.63,0.77,0.85,1.03,1.15,1.54,1.65,1.83,2.23,2.45,3.25]]).T
CBC9_cone_class=pd.DataFrame(CBC9_cone_class,columns=['cone','class','contacts','bc_contacts','bc_near','excentricity'])

In [3]:
CBC9_cone_class2=np.array([[7,6,10,29,61,9,31,14,23,100,28,17,90],[1,1,0,1,0,1,0,0,0,0,1,0,0],[1,3,1,1,0,0,0,0,0,0,2,1,0],\
          [1,1,0,0,1,1,1,1,1,1,0,1,1]]).T
CBC9_cone_class2=pd.DataFrame(CBC9_cone_class2,columns=['cone','class','bc_ending','bc_continuing'])

In [4]:
CBC9_cone_class.loc[:,'bc_ratio']=CBC9_cone_class['bc_contacts']/CBC9_cone_class['bc_near']

In [5]:
CBC9_cone_class2.loc[:,'bc_end_fract']=CBC9_cone_class2['bc_ending']/(CBC9_cone_class2['bc_ending']+CBC9_cone_class2['bc_continuing'])

In [6]:
plt.figure(figsize=(2.5/2.54,2.5/2.54))
sns.set(font='Arial',style='white',context='paper',rc={"xtick.major.size": 0, "ytick.major.size": 4})
ax=sns.swarmplot(x='class',y='contacts',order=[1,0],data=CBC9_cone_class,size=4)
ax.set(ylim=(0,10.5),xticklabels=['S','M'],xlabel='',ylabel='# contacts')
sns.despine(offset=3)
# plt.savefig('figures/s_vs_m_contacts.svg',bbox_inches='tight',dpi=300)



In [7]:
plt.figure(figsize=(2.5/2.54,2.5/2.54))
sns.set(font='Arial',style='white',context='paper',rc={"xtick.major.size": 0, "ytick.major.size": 4})
ax=sns.swarmplot(x='class',y='bc_ratio',order=[1,0],data=CBC9_cone_class,size=4)
ax.set(ylim=(0,1.05),xticklabels=['S','M'],xlabel='',ylabel='Fraction of\ncontacting BCs')
sns.despine(offset=3)
# plt.savefig('figures/s_vs_m_bc_fraction.svg',bbox_inches='tight',dpi=300)



In [8]:
plt.figure(figsize=(2.5/2.54,2.5/2.54))
sns.set(font='Arial',style='white',context='paper',rc={"xtick.major.size": 0, "ytick.major.size": 4})
ax=sns.swarmplot(x='class',y='bc_contacts',order=[1,0],data=CBC9_cone_class,size=4)
ax.set(ylim=(0,4.2),xticklabels=['S','M'],xlabel='',ylabel='# contacting BCs',yticks=[0,1,2,3,4])
sns.despine(offset=3)
# plt.savefig('figures/s_vs_m_bc_contacting.svg',bbox_inches='tight',dpi=300)



In [9]:
plt.figure(figsize=(2.5/2.54,2.5/2.54))
sns.set(font='Arial',style='white',context='paper',rc={"xtick.major.size": 0, "ytick.major.size": 4})
ax=sns.swarmplot(x='class',y='bc_end_fract',order=[1,0],data=CBC9_cone_class2,size=4)
ax.set(ylim=(0,1.05),xticklabels=['S','M'],xlabel='',ylabel='Fraction of\nending BCs')
sns.despine(offset=3)
# plt.savefig('figures/s_vs_m_bc_ending.svg',bbox_inches='tight',dpi=300)



In [ ]: