# HG changeset patch # User Henry S. Thompson # Date 1669144405 0 # Node ID 317bf47b506cda5602fa630e4bd073d4c58947a8 # Parent 91741bf3ab515c32a68e1b0ac81ec6adcc6af83b generalise hist diff -r 91741bf3ab51 -r 317bf47b506c bin/spearman.py --- a/bin/spearman.py Tue Nov 22 11:02:51 2022 +0000 +++ b/bin/spearman.py Tue Nov 22 19:13:25 2022 +0000 @@ -63,12 +63,20 @@ plt.grid(True) plt.show(block=block) -def hist(): - sdd=[(i,xm-(i*xsd)) for i in range(-2,3)] +def hist_x(): + hist(xm,xsd,[xd[i].mean for i in range(N)], + 'Mean of rank correlation of each segment x all other segments') + +def hist_all(): + hist(all_m,np.sqrt(all_s.variance),all, + 'Rank correlation of each segment x whole crawl') + +def hist(m,sd,hh,title): + sdd=[(i,m-(i*sd)) for i in range(-2,3)] fig,hax=plt.subplots() # Thanks to https://stackoverflow.com/a/7769497 sdax=hax.twiny() - hax.hist([xd[i].mean for i in range(N)],color='lightblue') - hax.set_title('Mean of rank correlation of each segment x all other segments') + hax.hist(hh,color='lightblue') + hax.set_title(title) for s,v in sdd: sdax.plot([v,v],[0,18],'b') sdax.set_xlim(hax.get_xlim())