def METHOD_NAME(x_name, f_name, y_lim):
    plt.figure(figsize=(4, 4))
    xs = np.asarray(range(2))
    for i in [0, 2]:
        fwd = np.asarray(data_fwd_mean[i]) / 1e3
        com = np.asarray(data_comm_mean[i]) / 1e3
        bwd = np.asarray(data_bwd_mean[i]) / 1e3
        fwd_stdv = np.asarray(data_fwd_stdv[i]) / 1e3
        com_stdv = np.asarray(data_comm_stdv[i]) / 1e3
        bwd_stdv = np.asarray(data_bwd_stdv[i]) / 1e3
        bwd -= com
        com *= 2
        configs = {
            "width": WIDTH,
            "color": colors[i],
            "edgecolor": "black",
            "capsize": 6,
        }
        plt.bar(xs + (i / 2 - 0.5) * WIDTH, fwd, yerr=fwd_stdv, hatch="///", **configs)
        plt.bar(
            xs + (i / 2 - 0.5) * WIDTH,
            com,
            yerr=com_stdv,
            hatch="\\\\\\",
            bottom=fwd,
            **configs,
        )
        plt.bar(
            xs + (i / 2 - 0.5) * WIDTH,
            bwd,
            yerr=bwd_stdv,
            hatch="...",
            bottom=fwd + com,
            **configs,
        )
    color_handles = []
    color_handles.append(plt.bar([4], [0], color=colors[0]))
    # color_handles.append(plt.bar([4], [0], color=colors[1]))
    color_handles.append(plt.bar([4], [0], color=colors[2]))
    color_names = ["DDP", "CUDA"]
    hatch_handles = []
    hatch_handles.append(plt.bar([4], [0], hatch="///", color="white"))
    hatch_handles.append(plt.bar([4], [0], hatch="\\\\\\", color="white"))
    hatch_handles.append(plt.bar([4], [0], hatch="...", color="white"))
    hatch_names = ["FWD", "COMM", "BWD"]
    def interleave(l1, l2):
        return [val for pair in zip(l1, l2) for val in pair]
    plt.legend(
        handles=hatch_handles + color_handles,
        loc="upper left",
        labels=hatch_names + color_names,
        prop={"family": FONT["fontname"], "size": FONT["size"] - 2},
        ncol=1,
        labelspacing=0.2,
        borderpad=0.2,
        handlelength=1,
        # bbox_to_anchor=(-0.015, 0.3, 0.5, 0.5)
    )
    plt.xticks(xs, ["4", "16"], **FONT)
    plt.yticks(**FONT)
    plt.xlabel(x_name, **FONT)
    plt.ylabel("Delay (Second)", **FONT)
    plt.ylim(y_lim)
    plt.xlim([-0.5, 1.5])
    # plt.yscale('log')
    if SHOW:
        plt.show()
    else:
        plt.savefig(f"../images/{f_name}.pdf", bbox_inches="tight")