def plot_runs(runs):
    ' Plot population evolutions\n    '
    ts = range(len(runs[0]))
    cmap = plt.get_cmap('viridis')
    for (i, r) in enumerate(runs):
        (mean, var) = zip(*r)
        (bm, cm) = zip(*mean)
        (bv, cv) = zip(*var)
        color = cmap((float(i) / len(runs)))
        plt.errorbar(ts, bm, fmt='-', yerr=bv, c=color)
        plt.errorbar(ts, cm, fmt='--', yerr=cv, c=color)
    plt.title('population evolution overview')
    plt.xlabel('time')
    plt.ylabel('value')
    plt.ylim((0, 1))
    plt.plot(0, 0, '-', c='black', label='benefit value')
    plt.plot(0, 0, '--', c='black', label='cost value')
    plt.legend(loc='best')
    plt.savefig('result.pdf')
    plt.show()
Plot population evolutions
def plot_runs(runs):
    ' \n    '
    ts = range(len(runs[0]))
    cmap = plt.get_cmap('viridis')
    for (i, r) in enumerate(runs):
        (mean, var) = zip(*r)
        (bm, cm) = zip(*mean)
        (bv, cv) = zip(*var)
        color = cmap((float(i) / len(runs)))
        plt.errorbar(ts, bm, fmt='-', yerr=bv, c=color)
        plt.errorbar(ts, cm, fmt='--', yerr=cv, c=color)
    plt.title('population evolution overview')
    plt.xlabel('time')
    plt.ylabel('value')
    plt.ylim((0, 1))
    plt.plot(0, 0, '-', c='black', label='benefit value')
    plt.plot(0, 0, '--', c='black', label='cost value')
    plt.legend(loc='best')
    plt.savefig('result.pdf')
    plt.show()