plot scan size distribution
(datapath, figname_prefix="")
| 41 | |
| 42 | |
| 43 | def plot_scan_size(datapath, figname_prefix=""): |
| 44 | """ |
| 45 | plot scan size distribution |
| 46 | |
| 47 | """ |
| 48 | |
| 49 | if not figname_prefix: |
| 50 | figname_prefix = datapath.split("/")[-1] |
| 51 | |
| 52 | scan_size_list, scan_size_cnt = _load_scan_size_data(datapath) |
| 53 | |
| 54 | plt.hist(scan_size_list, bins=100) |
| 55 | plt.xscale("log") |
| 56 | plt.yscale("log") |
| 57 | |
| 58 | plt.xlabel("Scan size") |
| 59 | plt.ylabel("Count") |
| 60 | plt.savefig("{}/{}_scan_size.{}".format(FIG_DIR, figname_prefix, FIG_TYPE), bbox_inches="tight") |
| 61 | plt.clf() |
| 62 | |
| 63 | x, y = conv_to_cdf(scan_size_cnt) |
| 64 | # x, y = [], [] |
| 65 | # for ss in sorted(scan_size_cnt.keys()): |
| 66 | # x.append(ss) |
| 67 | # y.append(ss * scan_size_cnt[ss]) |
| 68 | |
| 69 | plt.plot(x, y) |
| 70 | plt.xscale("log") |
| 71 | plt.yscale("log") |
| 72 | # plt.xlim(left=1) |
| 73 | # plt.yticks([1e-2, 1e-1, 1e0]) |
| 74 | plt.grid(linestyle="--") |
| 75 | plt.xlabel("Scan size") |
| 76 | plt.ylabel("CDF") |
| 77 | plt.savefig("{}/{}_scan_size_cdf.{}".format(FIG_DIR, figname_prefix, FIG_TYPE), bbox_inches="tight") |
| 78 | plt.clf() |
| 79 | |
| 80 | |
| 81 | if __name__ == "__main__": |
no test coverage detected