def METHOD_NAME(plug, range, fmt="svg", out="img.svg", time_unit="us"):
    stages = yaml.safe_load(range)
    db_init("m0play.db")
    db_connect()
    plt.figure(figsize=(12,4))
    nr_stages = len(stages)
    for nr,s in enumerate(stages, 1):
        r = dict(zipl(["from", "to", "end"], s, fillvalue=None))
        plt.subplot(1, nr_stages, nr)
        plt.grid(True)
        query(r["from"], r["to"], r["end"], plug, time_unit)
    db_close()
    plt.savefig(fname=out, format=fmt)