Spaces:
Build error
Build error
Download plot_cuc.py from bowdbeg/matching_series: direct link, hf CLI and curl.
- Browser
- Download file 616 Bytes
-
https://huggingface.co/spaces/bowdbeg/matching_series/resolve/main/plot_cuc.py
- Command line
-
hf download hf://spaces/bowdbeg/matching_series/plot_cuc.py
-
curl -L -o plot_cuc.py https://huggingface.co/spaces/bowdbeg/matching_series/resolve/main/plot_cuc.py
616 Bytes
| 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) | |