Exemple #1
0
def quick_plot(expt, prog, cell_str, ax, **kwds):
    from matt_axes_cust import clean_axes
    from numpy import r_
    if 'ylim' in kwds.keys():
        ylim = kwds.pop('ylim')
    else: ylim = (0,15)
    if 'xlim' in kwds.keys():
        xlim = kwds.pop('xlim')
    else: xlim = (-40,20)
    clean_axes(ax, **kwds)
    xs = r_[xlim[0]:xlim[1]:0.4]
    prog_swtch_time = prog.phs_swtch_time()
    # norm spike times
    exec("expt.%s.nrm_times(prog_swtch_time)[1:]" % (cell_str))
    exec("ys = expt.%s.inst_freq_intrp(xs)" % (cell_str))
    # un-norm spike time
    exec("expt.%s.nrm_times(prog_swtch_time*-1)[1:]" % (cell_str))
    ax.plot(xs, ys)
    ax.set_ylim(ylim)
    ax.set_xlim(xlim)
for swp_num, swp in enumerate(make_swp_indxs(fI.header)):
    swp_len = swp[1]-swp[0]
    swp_x_offset = 1.4 * swp_num
    swp_y_offset = 0 * swp_num
    xs = np.r_[0:swp_len/sr:xstep] + swp_x_offset
    ys = fI.read_data()[slice(swp[0],swp[1]),0] + swp_y_offset
    # make sure xs arnt too long, with float fups
    xs = xs[0:len(ys)]
    plt.plot(xs,ys, linewidth = 0.3, color = 'black')
    xmax = np.max(xs)
ax = plt.gca()
fig =plt.gcf()
ax.set_ylim((-65,25))
ax.set_xlim((0,xmax))

clean_axes(ax)
no_spines(ax)
# from matt_scalebars import mk_scale_bar
# mk_scale_bar(ax, horz_length_data = 1, vert_length_data = 20,
#              vert_units = 'mV', horz_units = 'sec', arrangement = 'qoph',
#              axescoords = (0.05,0.8), linewidth = 3, vpad = -0.03)

from matt_axes_cust import xscale, yscale
xscale(ax, 2, xloc_axs = 0.05, xalgn = 'left')
yscale(ax, 20, xloc_axs = 0.05, xalgn = 'left')
fig.set_size_inches((11,3))
fig.savefig('nice_fI.png', dpi = 110)
#################### END PLOT fI ####################

#################### PLOT latn I ####################
actv_epch = 1