I\'ve managed to plot a series of points with the following code:
plt = pp.figure() for i in range(spt.shape[1]): spktrain = spt[0,i] for trial in sp
You can use axhspan and/or axvspan like this:
axhspan
axvspan
import matplotlib.pyplot as plt plt.figure() plt.xlim(0, 5) plt.ylim(0, 5) for i in range(0, 5): plt.axhspan(i, i+.2, facecolor='0.2', alpha=0.5) plt.axvspan(i, i+.5, facecolor='b', alpha=0.5) plt.show()