I'm trying to create a raster plot of neural spike data using a numpy array given to me. The array has 2 columns such that the 1st column represents the neuron ID (which should appear on the y-axis) and the 2nd column represents the time of the spike (time will x-axis). Each row of the 2 columns is an individual spike. So if the 3rd column is (100, 200) that means the 3rd spike to be measured is by neuron no. 100 at time 200.
import matplotlib.pyplot as pyplot
import numpy as np
spike_data = np.load('spike_train_082019.npy')
pyplot.imshow(spike_data, cmap='Greys')
pyplot.show()
This is what I get: https://i.stack.imgur.com/lqrI5.jpg
Completely empty. Do I need to "parse" the axes of the numpy array? Can I just feed the loaded array into the imshow function? Any help appreciated.
1st edit: This is what I want to do, but no plot shows up at all now...
import numpy as np
spike_data = np.load('spike_train_082019.npy')
unit_id = spike_data[:,0]
spike_time = spike_data[:,1]
pyplot.scatter(spike_time, unit_id)
pyplot.show()