Skip to content

Instantly share code, notes, and snippets.

@rocapp
Last active September 16, 2016 17:32
Show Gist options
  • Save rocapp/3e0d2512fc31faf74f661c893833bf71 to your computer and use it in GitHub Desktop.
Save rocapp/3e0d2512fc31faf74f661c893833bf71 to your computer and use it in GitHub Desktop.
imshow for labeling raster plots
colors = np.array(colors) # color array (N, 3)
repimg = np.broadcast_to(colors, (nr_neurons, len(colors), 3)) # broadcast the array to split into time axes
for r in range(0, nr_neurons): # iterate through each time axis
bot, top = 0.5+r, 1.5-vspace+r # set the locations of the bottom and top of each imshow extent
ax.imshow(repimg[:, :, :], extent=(0., tspace[-1], bot, top), alpha=0.85, aspect='auto') # call imshow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment