# HG changeset patch # User mheinzl # Date 1563960935 14400 # Node ID 00f5ca6bb610e4ca2937da6e379245fb2b007aa1 # Parent 28fb192858ea21300e2c2f7a472cfc2aa5e1002b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty diff -r 28fb192858ea -r 00f5ca6bb610 fsd.py --- a/fsd.py Mon Jun 03 07:31:37 2019 -0400 +++ b/fsd.py Wed Jul 24 05:35:35 2019 -0400 @@ -282,9 +282,12 @@ ticks1[len(ticks1) - 1] = ">20" if to_plot[l] == "Relative frequencies": - counts_rel = ax.hist(list_to_plot2, bins=numpy.arange(minimumX, maximumX + 2), stacked=False, edgecolor="black", linewidth=1, label=label, align="left", alpha=0.6, rwidth=0.8, density=True, color=colors) + w = [numpy.zeros_like(data) + 1. / len(data) for data in list_to_plot2] + counts_rel = ax.hist(list_to_plot2, weights=w, + bins=numpy.arange(1, 23), stacked=False, edgecolor="black", + linewidth=1, label=label, align="left", alpha=0.7, rwidth=0.8) else: - counts = ax.hist(list_to_plot2, bins=numpy.arange(minimumX, maximumX + 2), stacked=False, edgecolor="black", linewidth=1, label=label, align="left", alpha=0.6, rwidth=0.8, color=colors) + counts = ax.hist(list_to_plot2, bins=numpy.arange(minimumX, maximumX + 2), stacked=False, edgecolor="black", linewidth=1, label=label, align="left", alpha=0.7, rwidth=0.8, color=colors) ax.legend(loc='upper right', fontsize=14, frameon=True, bbox_to_anchor=(0.9, 1)) ax.set_xticks(numpy.array(ticks)) @@ -338,14 +341,14 @@ w = 1./(len(list_to_plot) + 1) if to_plot[l] == "Relative frequencies": - new_y = list(numpy.concatenate((numpy.array([yi / float(numpy.sum(y)) for yi in y])))) - counts2_rel = ax.bar(x, new_y, align="edge", width=w, - edgecolor="black", label=label[i],linewidth=1, alpha=0.6, color=colors[i]) + counts2_rel = ax.bar(x, list(numpy.float_(y)) / numpy.sum(y), align="edge", width=w, + edgecolor="black", label=label[i],linewidth=1, alpha=0.7, color=colors[i]) else: y = list(y.reshape((len(y)))) + counts2 = ax.bar(x, y, align="edge", width=w, edgecolor="black", label=label[i], linewidth=1, - alpha=0.6, color=colors[i]) + alpha=0.7, color=colors[i]) if i == len(list_to_plot2): barWidth += 1. / (len(list_to_plot) + 1) + 1. / (len(list_to_plot) + 1) else: diff -r 28fb192858ea -r 00f5ca6bb610 test-data/fsd_output1.pdf Binary file test-data/fsd_output1.pdf has changed diff -r 28fb192858ea -r 00f5ca6bb610 test-data/fsd_output2.pdf Binary file test-data/fsd_output2.pdf has changed