[pointprocesses] fixed raster plot
This commit is contained in:
parent
d7415a85b2
commit
1ce7acb2ea
@ -282,7 +282,7 @@ def axis_label(label, unit=None):
|
||||
if not unit:
|
||||
return label
|
||||
elif xkcd_style:
|
||||
return '%s/%s' % (label, unit)
|
||||
return '%s (%s)' % (label, unit)
|
||||
else:
|
||||
return '%s [%s]' % (label, unit)
|
||||
|
||||
|
@ -69,7 +69,9 @@ def plot_homogeneous_spikes(ax):
|
||||
ax.set_title('stationary')
|
||||
ax.set_xlim(0.0, duration)
|
||||
ax.set_ylim(-0.5, trials-0.5)
|
||||
ax.set_xlabel('Time [s]')
|
||||
ax.set_xticks([0, 1, 2])
|
||||
ax.set_yticks(np.arange(0, trials+1, 5))
|
||||
ax.set_xlabel('Time', 's')
|
||||
ax.set_ylabel('Trial')
|
||||
ax.eventplot(homspikes, colors=[lsA['color']], linelength=0.8, lw=1)
|
||||
|
||||
@ -79,14 +81,16 @@ def plot_inhomogeneous_spikes(ax):
|
||||
ax.set_title('non-stationary')
|
||||
ax.set_xlim(0.0, duration)
|
||||
ax.set_ylim(-0.5, trials-0.5)
|
||||
ax.set_xlabel('Time [s]')
|
||||
ax.set_ylabel('Trial')
|
||||
ax.set_xticks([0, 1, 2])
|
||||
ax.set_yticks(np.arange(0, trials+1, 5))
|
||||
ax.set_xlabel('Time', 's')
|
||||
#ax.set_ylabel('Trial')
|
||||
ax.eventplot(inhspikes, colors=[lsA['color']], linelength=0.8, lw=1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
fig, (ax1, ax2) = plt.subplots(1, 2)
|
||||
fig.subplots_adjust(**adjust_fs(fig, left=4.0, right=1.0, top=1.2))
|
||||
fig.subplots_adjust(**adjust_fs(fig, left=5.0, right=1.0, top=1.2))
|
||||
plot_homogeneous_spikes(ax1)
|
||||
plot_inhomogeneous_spikes(ax2)
|
||||
plt.savefig('rasterexamples.pdf')
|
||||
|
Reference in New Issue
Block a user