Example #1
0
File: plot.py Project: ntejos/Barak
def test_distplot(n=100):
    a = [np.random.randn(n) for i in range(10)]
    x = range(len(a))
    ax = distplot(x, a, showoutliers=1)
    ax = distplot(x, a, color='r')
    ax = distplot(x, a, label='points', color='b', showmean=1)
    ax.legend()
Example #2
0
File: plot.py Project: ninoc/Barak
def test_distplot(n=100):
    a = [np.random.randn(n) for i in range(10)]
    x = range(len(a))
    ax = distplot(x, a, showoutliers=1)
    ax = distplot(x, a, color="r")
    ax = distplot(x, a, label="points", color="b", showmean=1)
    ax.legend()
Example #3
0
def plot_autocorr(chain):
    """ Plot the autocorrelation of parameters in the chain. This can
    be slow if there are many parameters.
    """
    nwalkers, nsamples, npar = chain.shape
    nrows, ncols = get_nrows_ncols(npar)
    fig,axes = get_fig_axes(nrows, ncols, npar)
    for i,ax in enumerate(axes):
        acor = [autocorr(chain[j,:,i], maxlag=150) for j in xrange(nwalkers)]
        distplot(np.transpose(acor), ax=ax)
        ax.axhline(0, color='r', lw=0.5)
        puttext(0.1, 0.1, P['names'][i], ax, fontsize=16)

    return fig, axes
Example #4
0
def plot_autocorr(chain):
    """ Plot the autocorrelation of parameters in the chain. This can
    be slow if there are many parameters.
    """
    nwalkers, nsamples, npar = chain.shape
    nrows, ncols = get_nrows_ncols(npar)
    fig, axes = get_fig_axes(nrows, ncols, npar)
    for i, ax in enumerate(axes):
        acor = [autocorr(chain[j, :, i], maxlag=150) for j in xrange(nwalkers)]
        distplot(np.transpose(acor), ax=ax)
        ax.axhline(0, color='r', lw=0.5)
        puttext(0.1, 0.1, P['names'][i], ax, fontsize=16)

    return fig, axes