Skip to content

Commit

Permalink
Minor changes to plotting scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ycanerol committed Jun 27, 2017
1 parent 5ecb47b commit 6264a0e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
31 changes: 23 additions & 8 deletions figure_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@

import numpy as np
import matplotlib.pyplot as plt
import matplotlib


# Exp date Cluster Label Flipped
plotthis = [['2017_02_14', '901', 'On cell', False],
['2017_01_31', '8401', 'Off cell', True],
['2017_01_17', '201', 'On off 1', True]]
# Exp date Cluster Label Flipped
plotthis = [['2017_02_14', '901', 'On cell', False],
['2017_01_31', '8401', 'Off cell', True],
['2017_01_17', '201', 'On off 1', True],
['2017_01_17', '4105', 'Off to on',False],
['2017_02_14', '22302', 'On to off',True],
]


for i in plotthis:

Expand All @@ -31,13 +36,18 @@
f = np.load(str(currentfile_f))

savepath = '/Users/ycan/Documents/official/gottingen/lab rotations/\
LR3 Gollisch/figures' + i[2]
LR3 Gollisch/figures/replotted/' + i[2]

flipper = 1
if i[3]:
flipper = -1

# %% plot all
matplotlib.rcParams['axes.spines.right'] = False
matplotlib.rcParams['axes.spines.top'] = False
matplotlib.rcParams['axes.spines.left'] = True
matplotlib.rcParams['axes.spines.bottom'] = True

plt.figure(figsize=(12, 12), dpi=200)
plt.suptitle(str(' '.join(str(c['spike_path'])
.split('rasters')[0].split('Experiments')[1]
Expand Down Expand Up @@ -101,6 +111,11 @@
plt.xlabel('Eigenvalue index')
plt.ylabel('Variance')

matplotlib.rcParams['axes.spines.right'] = False
matplotlib.rcParams['axes.spines.top'] = False
matplotlib.rcParams['axes.spines.left'] = False
matplotlib.rcParams['axes.spines.bottom'] = False

plt.subplot(3, 3, 7)
plt.imshow(c['sta_unscaled'][:, :, c['max_i'][2]].reshape((60, 80,)),
cmap='Greys',
Expand All @@ -118,6 +133,6 @@
vmax=np.max(c['sta_unscaled']))
plt.title('Brightest pixel: {}'.format(c['max_i']))
plt.tight_layout(pad=5, h_pad=1, w_pad=1.8)
plt.show()
# plt.savefig(savepath, dpi=200, bbox_inches='tight')
# plt.show()
plt.savefig(savepath, dpi=200, bbox_inches='tight')
plt.close()
5 changes: 5 additions & 0 deletions onoffplotter_dimos.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@
# %%
exp_name = 'all_experiments'

hist_axis_limits = [-1, 1, 0, 30]

w_pf = np.sum(dataset_sizes[:2]) # Index at which data with preframes start

# Divide experiments into two, without and with preframes
Expand All @@ -233,17 +235,20 @@
plt.hist(all_f, bins=np.linspace(-1, 1, num=40),
alpha=.5, color='C0')
plt.xticks(ticks)
plt.axis(hist_axis_limits)
plt.ylabel('FFF')
plt.subplot(6, 2, 3)
plt.ylabel('Checker')
plt.hist(all_c, bins=np.linspace(-1, 1, num=40),
alpha=.5, color='C1')
plt.xticks(ticks)
plt.axis(hist_axis_limits)
plt.subplot(6, 2, 5)
plt.ylabel('On off steps')
plt.hist(all_o, bins=np.linspace(-1, 1, num=40),
alpha=.5, color='C2')
plt.xticks(ticks)
plt.axis(hist_axis_limits)
plt.xlabel('On-off index')
plt.subplots_adjust(hspace=.4)

Expand Down

0 comments on commit 6264a0e

Please sign in to comment.