def make_plot(data, action, save=False, show=False, limit=0.005):
    "Make plot."
    fig, ax = plt.subplots(figsize=(8, 10))
    colors = ['#ff7f00', '#377eb8', '#4daf4a', '#984ea3', '#e41a1c']
    width = 0.15

    ticks = ('Median', 'P90', 'P99')
    index = (0, 1, 2)
    names = list(data)
    bars = []

    for pos, (name, color) in enumerate(zip(names, colors)):
        bars.append(ax.bar(
            [val + pos * width for val in index],
            [parse_timing(data[name][action][tick], limit) for tick in ticks],
            width,
            color=color,
        ))

    ax.set_ylabel('Time (s)')
    ax.set_title('"%s" Time vs Percentile' % action)
    ax.set_xticks([val + width * (len(data) / 2) for val in index])
    ax.set_xticklabels(ticks)

    box = ax.get_position()
    ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8])
    ax.legend(
        [bar[0] for bar in bars],
        names,
        loc='lower center',
        bbox_to_anchor=(0.5, -0.3)
    )

    if show:
        plt.show()

    if save:
        plt.savefig((save, action) % '%s-%s.png', dpi=80, bbox_inches='tight')

    plt.close()
dataset/ETHPy150Open grantjenks/python-diskcache/tests/plot.py/make_plot/swapped operands of `%`