Spaces:
Sleeping
Sleeping
import json | |
from argparse import ArgumentParser | |
import matplotlib.pyplot as plt | |
parser = ArgumentParser() | |
parser.add_argument("input", type=str, help="Input file of json data, output of matching_series") | |
parser.add_argument("output", type=str, help="Output file of the plot") | |
args = parser.parse_args() | |
with open(args.input, "r") as f: | |
data = json.load(f) | |
coverages = data["coverages"] | |
x = [2**i for i in range(len(coverages))] | |
y = coverages | |
fig, ax = plt.subplots() | |
ax.plot(x, y, "o-") | |
ax.set_xscale("log", base=2) | |
ax.set_xlabel("Number of generations") | |
ax.set_ylabel("Coverage") | |
plt.savefig(args.output) | |