In [1]:
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
%matplotlib inline
import urllib2
import numpy as np
import matplotlib as mpl
mpl.rcParams['font.size'] = 25
mpl.rc('font',family='Times New Roman')

np.set_printoptions(precision=3, suppress=True)
url = ('https://raw.githubusercontent.com/Upward-Spiral-Science'
       '/data/master/syn-density/output.csv')
data = urllib2.urlopen(url)
csv = np.genfromtxt(data, delimiter=",")[1:]

In [82]:
#constant x, constant z
x = np.unique(csv[:,0])
xRange = np.where(csv[:,0]==x[51])

z = np.unique(csv[:,2])
zRange = np.where(csv[:,2]==z[6])

csvx = csv[xRange,:]
csvx = csvx[0,:,:]
csvz = csv[zRange,:]
csvz = csvz[0,:,:]

xzRange = np.where(csvz[:,0]==2008)
xzplane = csvz[xzRange,:]
xzplane = xzplane[0,:,:]
print xzplane.shape

y1 = xzplane[2,:]
y2 = xzplane[12,:]
y3 = xzplane[22,:]
y4 = xzplane[32,:]
y5 = xzplane[42,:]


(52L, 5L)

In [76]:
print y1
print y2
print y3
print y4
print y5


[   2008.    1564.     721.  147295.     167.]
[   2008.    1954.     721.  149449.     175.]
[   2008.    2344.     721.  150766.     139.]
[   2008.    2734.     721.  147513.     193.]
[  2008.   3124.    721.  66814.     47.]

Then I used the Figure1imaging.ipynb to look at the images at each coordinate.


In [91]:
y1count = 194
y2count = 289
y3count = 342
y4count = 386
y5count = 98

yvals = [y1[1],y2[1],y3[1],y4[1],y5[1]]
mycount = [y1count,y2count,y3count,y4count,y5count]
compcount = [y1[-1],y2[-1],y3[-1],y4[-1],y5[-1]]

In [102]:
#plot 1
fig,ax = plt.subplots()
ax.set_title('Synapse counts across y')
ax.set_ylim([0,400])
ax.set_xlim([1500,3000])
ax.set_yticks([0,100,200,300,400])
ax.set_xticks([1500,2000,2500,3000])
ax.set_xlabel('y value')
ax.set_ylabel('synapse counts')
ax.plot(yvals, compcount, label = 'comp.', color = 'black')
ax.plot(yvals, mycount, label = 'manual', color = 'blue')
legend = ax.legend(loc='lower left',fontsize=15)
plt.subplots_adjust(bottom = 0.2)
plt.subplots_adjust(left = 0.2)
plt.savefig('Fig1.pdf', format='pdf', dpi=1000)
plt.show()



In [ ]: