Skip to content

Commit ca9d6f4

Browse files
committed
Improved bestK plot for readability.
1 parent 99a51e6 commit ca9d6f4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

structure_threader/plotter/structplot.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,11 +953,22 @@ def plot_normalization(norm_dict, outdir):
953953

954954
data = [(k, [vals[x] for x in keys]) for k, vals in norm_dict.items()]
955955

956+
xlabs = ["K" + str(x) for x in norm_dict.keys()]
957+
956958
means = [x[1][0] for x in data]
957959
lower_limit = [x[1][0] - x[1][1] for x in data]
958960
upper_limit = [x[1][2] - x[1][0] for x in data]
959961

960-
plt.bar(range(len(means)), means, yerr=[lower_limit, upper_limit])
962+
plt.bar(range(len(means)), means, 0.5, yerr=[lower_limit, upper_limit],
963+
fc=(0, 0, 1, 0.5), edgecolor="blue", linewidth=1.5, capsize=5)
964+
plt.xticks(range(len(xlabs)), xlabs)
965+
axes = plt.gca()
966+
axes.set_ylabel("Posterior probability")
967+
axes.set_xlabel("Ks")
968+
axes.set_facecolor('white')
969+
axes.spines["bottom"].set_color("black")
970+
axes.spines["left"].set_color("black")
971+
axes.set_ylim([0, 1])
961972

962973
plt.savefig(join(outdir, "bestK", "bestk_evidence.svg"), dpi=200)
963974

0 commit comments

Comments
 (0)