Beispiel #1
0
    # possibleFreqLabels = ["{0:.1f}".format(freq) for freq in np.unique(thalPopStat)]
    ytickLabels = [4, 8, 16, 32, 64, 128]
    yticks = np.log(ytickLabels)

    acPopStat = np.log(acPopStat)
    thalPopStat = np.log(thalPopStat)

    axSummary = plt.subplot(gs[0, 5])
    spacing = 0.07
    plt.sca(axSummary)

    # pos = jitter(np.ones(len(thalPopStat))*0, 0.20)
    # axSummary.plot(pos, thalPopStat, 'o', mec = colorATh, mfc = 'None', alpha=0.5)
    plt.hold(1)
    markers = extraplots.spread_plot(0, thalPopStat, spacing)
    plt.setp(markers, mec=colorD1, mfc='None')
    plt.setp(markers, ms=dataMS)

    plt.hold(1)
    medline(np.median(thalPopStat), 0, 0.5)
    plt.hold(1)

    # pos = jitter(np.ones(len(acPopStat))*1, 0.20)
    # axSummary.plot(pos, acPopStat, 'o', mec = colorAC, mfc = 'None', alpha=0.5)
    markers = extraplots.spread_plot(1, acPopStat, spacing)
    plt.setp(markers, mec=colornD1, mfc='None')
    plt.setp(markers, ms=dataMS)

    plt.hold(1)
    medline(np.median(acPopStat), 1, 0.5)
Beispiel #2
0
    #plt.hold(1)
#
#plt.hold(True)

# ======================= Beginning of plotting for threshold ================================
if PANELS[3]:

    popStatCol = 'thresholdFRA'
    D1PopStat = D1[popStatCol][pd.notnull(D1[popStatCol])]
    nD1PopStat = nD1[popStatCol][pd.notnull(nD1[popStatCol])]

    plt.sca(axThresh)

    spacing = 0.05

    markers = extraplots.spread_plot(0, nD1PopStat, spacing)
    plt.setp(markers, mec=colornD1, mfc='None')
    medline(axThresh, np.median(nD1PopStat), 0, 0.5)

    markers = extraplots.spread_plot(1, D1PopStat, spacing)
    plt.setp(markers, mec=colorD1, mfc='None')

    medline(axThresh, np.median(D1PopStat), 1, 0.5)
    axThresh.set_ylabel('Threshold (dB SPL)', fontsize=fontSizeLabels)
    tickLabels = ['nD1:Str\nn={}'.format(len(nD1PopStat)), 'D1:Str\nn={}'.format(len(D1PopStat))]
    axThresh.set_xticks(range(2))
    axThresh.set_xlim([-0.5, 1.5])
    axThresh.set_ylim([0, 71])
    extraplots.boxoff(axThresh)
    extraplots.set_ticks_fontsize(axThresh, fontSizeTicks)
'''
Test plot where many samples are plotted at quantized levels.
'''

from jaratoolbox import extraplots
reload(extraplots)
from matplotlib import pyplot as plt
import numpy as np

plt.clf()
plt.hold(True)

y = np.array([1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 6, 6])
x = 0

hp = extraplots.spread_plot(x, y, spacing=0.03)
plt.setp(hp, mec='r', mew=2)
'''
possibleOffsetsOdd = 0.05*np.array([0,-1,1,-2,2,-3,3])
possibleOffsetsEven = 0.05*np.array([-0.5,0.5,-1.5,1.5,-2.5,2.5])

spacing = 0.03
uniqueY = np.unique(y)
for oneY in uniqueY:
    nVals = np.sum(y==oneY)
    #possibleOffsets = possibleOffsetsOdd if nVals%2 else possibleOffsetsEven
    possibleOffsets = spacing * np.arange(-nVals/2.0+0.5, nVals/2.0, 1)
    """
    if nVals%2:
        possibleOffsets = spacing * np.arange(-nVals/2.0+0.5, nVals/2.0, 1)
    else: