Skip to content

Commit

Permalink
- Add axis labels for all graphs
Browse files Browse the repository at this point in the history
- Fix orientation for STA graphs
  • Loading branch information
ycanerol committed May 17, 2017
1 parent a942c8e commit a64541d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion LNP_model
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Created on Tue May 9 18:11:51 2017
import numpy as np
from scipy.stats.mstats import mquantiles

total_frames = 200000
total_frames = 400000
dt = 0.01 # Time step
t = np.arange(0, total_frames*dt, dt) # Time vector
filter_time = .6 # The longest feature RGCs respond to is ~600ms
Expand Down
13 changes: 8 additions & 5 deletions plotLNP.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
plt.style.use('default')
matplotlib.rcParams['grid.alpha'] = 0.1
rows = 2
columns = 2
fig = plt.figure(figsize=(12, 8))
columns = 1
fig = plt.figure(figsize=(8, 8.5))

plt.subplot(rows, columns, 1)
plt.plot(filter_kernel1, alpha=.2)
Expand All @@ -31,11 +31,12 @@
'Filter {}'.format(filter_index2),
'{}*Filter {}+{}*Filter {}'.format(cweight, filter_index1,
np.round(1-cweight,2),filter_index2),
'Spike triggered average (STA)'],
'Spike triggered average (STA)'],
fontsize='x-small')
plt.grid()
plt.title('Linear transformation')
plt.xlabel('Time [ms]')
plt.title('Linear filters')
plt.xlabel('?')
plt.ylabel('?')


plt.subplot(rows,columns,2)
Expand All @@ -59,6 +60,8 @@
'Recovered using quantiles'],
fontsize='x-small')
plt.title('Non-linear transformation')
plt.xlabel('?')
plt.ylabel('?')

plt.show()
print('{} seconds were simulated with {} s time steps.'
Expand Down
14 changes: 9 additions & 5 deletions stc.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,21 @@ def stc(spikes, stimulus, filter_length, sta_temp):
w = w[sorted_eig]
v = v[:, sorted_eig]

fig=plt.figure(figsize=(12, 4))
fig = plt.figure(figsize=(12, 4))

plt.subplot(1,2,1)
plt.subplot(1, 2, 1)
plt.plot(w, 'o', markersize=2)
plt.xlabel('Eigenvalue index')
plt.ylabel('Variance')

plt.subplot(1,2,2)
plt.subplot(1, 2, 2)
plt.plot(v[:, 0])
plt.plot(v[:, 1])
plt.plot(recovered_kernel)
plt.legend(['0', '1', 'STA'], fontsize='x-small')

plt.legend(['Eigenvector 0', 'Eigenvector 1', 'STA'], fontsize='x-small')
plt.title('Filters recovered by STC')
plt.xlabel('?')
plt.ylabel('?')

#plt.plot(v[:, -1])
#plt.plot(v[:, -2])
Expand Down

0 comments on commit a64541d

Please sign in to comment.