Browse Source

update

tags/v0.0.1
刘政 2 weeks ago
parent
commit
3588a24b16
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      gui/plot_function.py

+ 9
- 4
gui/plot_function.py View File

@@ -266,18 +266,23 @@ def find_all_area_fr(time=10.5, label='111111', step=0.0001, area=None):
spike = ((spike - fire_mean) /fire_std).astype(np.int16)
spike[spike < 0] = 0

indices = np.random.choice(num_spikes, int(round(num_spikes * 0.01)))
indices = np.sort(np.random.choice(num_spikes, int(round(num_spikes * 0.01))))

result = np.zeros_like(spike)
result[indices] = spike[indices]
data = {'time':time_range, 'spike':result}
np.save('result.npy', data)

figure = plt.figure ()
gs = gridspec.GridSpec(3, 1)
ax1 = plt.subplot(gs[0])
ax1.plot(np.sort(time_range[indices]), spike[indices, 0])
ax1.plot(time_range, result[:, 0])
ax1.set_ylim((0, 6))
ax2 = plt.subplot(gs[1])
ax2.plot(np.sort(time_range[indices]), spike[indices, 1])
ax2.plot(time_range, result[:, 1])
ax2.set_ylim((0, 6))
ax3 = plt.subplot(gs[2])
ax3.plot(np.sort(time_range[indices]), spike[indices, 2])
ax3.plot(time_range, result[:, 2])
ax3.set_ylim((0, 6))




Loading…
Cancel
Save