def plot_walkers(sampler, limits=None, bad=None):
    '\n    sampler :  emcee Sampler class\n    '
    if hasattr(sampler, '__getitem__'):
        chain = sampler
        ndim = chain.shape[(- 1)]
    else:
        chain = sampler.chain
        ndim = sampler.ndim
    fig = plt.figure(figsize=((8 * ndim), (4 * ndim)))
    if hasattr(limits, '__getitem__'):
        limits += ([None] * (3 - len(limits)))
        slices = slice(limits[0], limits[1], limits[2])
    else:
        slices = slice(None, limits, None)
    for (w, walk) in enumerate(chain[:, slices, :]):
        if (bad is None):
            color = 'k'
        elif bad[w]:
            color = 'r'
        else:
            color = 'k'
        for (p, param) in enumerate(walk.T):
            ax = plt.subplot(ndim, 1, (p + 1))
            ax.plot(param, color, alpha=0.75, lw=0.75)
    plt.tight_layout()
    return fig
sampler :  emcee Sampler class
def plot_walkers(sampler, limits=None, bad=None):
    '\n    \n    '
    if hasattr(sampler, '__getitem__'):
        chain = sampler
        ndim = chain.shape[(- 1)]
    else:
        chain = sampler.chain
        ndim = sampler.ndim
    fig = plt.figure(figsize=((8 * ndim), (4 * ndim)))
    if hasattr(limits, '__getitem__'):
        limits += ([None] * (3 - len(limits)))
        slices = slice(limits[0], limits[1], limits[2])
    else:
        slices = slice(None, limits, None)
    for (w, walk) in enumerate(chain[:, slices, :]):
        if (bad is None):
            color = 'k'
        elif bad[w]:
            color = 'r'
        else:
            color = 'k'
        for (p, param) in enumerate(walk.T):
            ax = plt.subplot(ndim, 1, (p + 1))
            ax.plot(param, color, alpha=0.75, lw=0.75)
    plt.tight_layout()
    return fig