Example #1
0
def plotIToEBrokenAxis(sp,
                       gIdx,
                       neuronIdx,
                       trialNum=0,
                       axBoundaries=None,
                       axesProportions=(0.5, 0.5),
                       bottomLimits=None,
                       topLimits=None,
                       **kw):
    if axBoundaries is None:
        axBoundaries = [0, 0, 1, 1]
    left, bottom, right, top = axBoundaries
    title = kw.pop('title', 'E cell')
    fig = kw.pop('fig', plt.gcf())
    h = top - bottom
    w = right - left
    hBottom = h * axesProportions[0]
    hTop = h * axesProportions[1]

    axBottom = fig.add_axes(
        Bbox.from_extents(left, bottom, right, bottom + hBottom))
    axTop = fig.add_axes(Bbox.from_extents(left, top - hTop, right, top),
                         sharex=axBottom)

    _, gI = aggr.computeYX(sp, iterList)
    M = sp[0][gIdx][trialNum].data['g_EI']
    conns = M[neuronIdx, :]

    pconn.plotConnHistogram(conns, title=title, ax=axBottom, **kw)
    kw['ylabel'] = ''
    pconn.plotConnHistogram(conns, title=title, ax=axTop, **kw)
    annG = gI[0, gIdx]
    if annG - int(annG) == 0:
        annG = int(annG)
    #ann = '$g_I$ = {0} nS'.format(annG)
    #fig.text(left+0.95*w, bottom+0.9*h, ann, ha='right', va='bottom',
    #        fontsize='x-small')

    axBottom.set_xlim([0, annG])
    axBottom.set_xticks([0, annG])
    axBottom.xaxis.set_ticklabels([0, '$g_I$'])
    axBottom.set_ylim(bottomLimits)
    axBottom.set_yticks(bottomLimits)
    axBottom.yaxis.set_minor_locator(ti.NullLocator())
    axTop.set_ylim(topLimits)
    axTop.set_yticks([topLimits[1]])
    axTop.xaxis.set_visible(False)
    axTop.spines['bottom'].set_visible(False)

    divLen = 0.07
    d = .015
    kwargs = dict(transform=fig.transFigure, color='k', clip_on=False)
    axBottom.plot((left - divLen * w, left + divLen * w),
                  (bottom + hBottom + d, bottom + hBottom - d), **kwargs)
    axTop.plot((left - divLen * w, left + divLen * w),
               (top - hTop + d, top - hTop - d), **kwargs)

    return axBottom, axTop
Example #2
0
def plotIToEBrokenAxis(sp, gIdx, neuronIdx, trialNum=0, axBoundaries=None,
                       axesProportions=(0.5, 0.5), bottomLimits=None,
                       topLimits=None, **kw):
    if axBoundaries is None:
        axBoundaries = [0, 0, 1, 1]
    left, bottom, right, top = axBoundaries
    title = kw.pop('title', 'E cell')
    fig   = kw.pop('fig', plt.gcf())
    h = top - bottom
    w = right - left
    hBottom = h*axesProportions[0]
    hTop = h*axesProportions[1]

    axBottom = fig.add_axes(Bbox.from_extents(left, bottom, right, bottom +
                                              hBottom))
    axTop = fig.add_axes(Bbox.from_extents(left, top - hTop, right, top),
                         sharex=axBottom)

    _, gI = aggr.computeYX(sp, iterList)
    M      = sp[0][gIdx][trialNum].data['g_EI']
    conns  = M[neuronIdx, :]

    pconn.plotConnHistogram(conns, title=title, ax=axBottom, **kw)
    kw['ylabel'] = ''
    pconn.plotConnHistogram(conns, title=title, ax=axTop, **kw)
    annG = gI[0, gIdx]
    if annG - int(annG) == 0:
        annG = int(annG)
    #ann = '$g_I$ = {0} nS'.format(annG)
    #fig.text(left+0.95*w, bottom+0.9*h, ann, ha='right', va='bottom',
    #        fontsize='x-small')

    axBottom.set_xlim([0, annG])
    axBottom.set_xticks([0, annG])
    axBottom.xaxis.set_ticklabels([0, '$g_I$'])
    axBottom.set_ylim(bottomLimits)
    axBottom.set_yticks(bottomLimits)
    axBottom.yaxis.set_minor_locator(ti.NullLocator())
    axTop.set_ylim(topLimits)
    axTop.set_yticks([topLimits[1]])
    axTop.xaxis.set_visible(False)
    axTop.spines['bottom'].set_visible(False)

    divLen = 0.07
    d = .015
    kwargs = dict(transform=fig.transFigure, color='k', clip_on=False)
    axBottom.plot((left-divLen*w, left+divLen*w), (bottom+hBottom + d,
                                                   bottom+hBottom - d),
                  **kwargs)
    axTop.plot((left-divLen*w, left+divLen*w), (top-hTop + d, top-hTop - d),
               **kwargs)

    return axBottom, axTop
Example #3
0
def plotIToE(sp, gIdx, neuronIdx, trialNum=0, **kw):
    title = kw.pop('title', 'E cell')

    gE, gI = aggr.computeYX(sp, iterList)
    M      = sp[0][gIdx][trialNum].data['g_EI']
    conns  = M[neuronIdx, :]
    ax = pconn.plotConnHistogram(conns,
            title=title, **kw)
    annG = gI[0, gIdx]
    if (annG - int(annG) == 0):
        annG = int(annG)
    ann = '$g_I$ = {0} nS'.format(annG)
    ax.text(0.95, 0.9, ann, ha='right', va='bottom', fontsize='x-small',
            transform=ax.transAxes)
    ax.set_xlim([0, annG])
    ax.set_xticks([0, annG])
Example #4
0
def plotEToI(sp, gIdx, neuronIdx, trialNum=0, **kw):
    title = kw.pop('title', 'I cell')
    ylim = kw.pop('ylim', None)

    gE, gI = aggr.computeYX(sp, iterList)
    M = sp[0][gIdx][trialNum].data['g_IE']
    conns = M[neuronIdx, :]
    ax = pconn.plotConnHistogram(conns, title=title, **kw)
    annG = gE[0, gIdx]
    if (annG - int(annG) == 0):
        annG = int(annG)
    #ann = '$g_E$ = {0} nS'.format(annG)
    #ax.text(0.95, 0.9, ann, ha='right', va='bottom', fontsize='x-small',
    #        transform=ax.transAxes)
    ax.set_xlim([0, annG])
    ax.set_xticks([0, annG])
    ax.xaxis.set_ticklabels([0, '$g_E$'])
    ax.set_ylim(ylim)
Example #5
0
def plotEToI(sp, gIdx, neuronIdx, trialNum=0, **kw):
    title = kw.pop('title', 'I cell')
    ylim  = kw.pop('ylim', None)

    gE, gI = aggr.computeYX(sp, iterList)
    M      = sp[0][gIdx][trialNum].data['g_IE']
    conns  = M[neuronIdx, :]
    ax = pconn.plotConnHistogram(conns,
            title=title, **kw)
    annG = gE[0, gIdx]
    if (annG - int(annG) == 0):
        annG = int(annG)
    #ann = '$g_E$ = {0} nS'.format(annG)
    #ax.text(0.95, 0.9, ann, ha='right', va='bottom', fontsize='x-small',
    #        transform=ax.transAxes)
    ax.set_xlim([0, annG])
    ax.set_xticks([0, annG])
    ax.xaxis.set_ticklabels([0, '$g_E$'])
    ax.set_ylim(ylim)
Example #6
0
def plotIToE(sp, gIdx, neuronIdx, trialNum=0, **kw):
    title = kw.pop('title', 'E cell')

    gE, gI = aggr.computeYX(sp, iterList)
    M = sp[0][gIdx][trialNum].data['g_EI']
    conns = M[neuronIdx, :]
    ax = pconn.plotConnHistogram(conns, title=title, **kw)
    annG = gI[0, gIdx]
    if (annG - int(annG) == 0):
        annG = int(annG)
    ann = '$g_I$ = {0} nS'.format(annG)
    ax.text(0.95,
            0.9,
            ann,
            ha='right',
            va='bottom',
            fontsize='x-small',
            transform=ax.transAxes)
    ax.set_xlim([0, annG])
    ax.set_xticks([0, annG])