|
38 | 38 |
|
39 | 39 | # Create color pallete |
40 | 40 | c = cl.scales["12"]["qual"]["Set3"] |
41 | | - |
| 41 | +plt.style.use("ggplot") |
42 | 42 |
|
43 | 43 | class PlotK: |
44 | 44 | """ |
@@ -848,8 +848,6 @@ def plotk_static(self, kval, output_dir, bw=False, use_ind=False): |
848 | 848 | with the --ind option, use those labels instead of population labels |
849 | 849 | """ |
850 | 850 |
|
851 | | - plt.style.use("ggplot") |
852 | | - |
853 | 851 | numinds = self.number_indv |
854 | 852 |
|
855 | 853 | clist = [[i / 255. for i in x] for x in cl.to_numeric(c)] |
@@ -944,6 +942,23 @@ def plotk_static(self, kval, output_dir, bw=False, use_ind=False): |
944 | 942 | plt.close() |
945 | 943 |
|
946 | 944 |
|
| 945 | +def plot_normalization(norm_dict, outdir): |
| 946 | + |
| 947 | + plt.clf() |
| 948 | + |
| 949 | + keys = ["norm_mean", "lower_limit", "upper_limit"] |
| 950 | + |
| 951 | + data = [(k, [vals[x] for x in keys]) for k, vals in norm_dict.items()] |
| 952 | + |
| 953 | + means = [x[1][0] for x in data] |
| 954 | + lower_limit = [x[1][0] - x[1][1] for x in data] |
| 955 | + upper_limit = [x[1][2] - x[1][0] for x in data] |
| 956 | + |
| 957 | + plt.bar(range(len(means)), means, yerr=[lower_limit, upper_limit]) |
| 958 | + |
| 959 | + plt.savefig(join(outdir, "bestK", "bestk_evidence.svg"), dpi=200) |
| 960 | + |
| 961 | + |
947 | 962 | def main(result_files, fmt, outdir, bestk=None, popfile=None, indfile=None, |
948 | 963 | filter_k=None, bw=False, use_ind=False): |
949 | 964 | """ |
|
0 commit comments