Author: tlinnet Date: Tue Sep 16 02:03:38 2014 New Revision: 25852 URL: http://svn.gna.org/viewcvs/relax?rev=25852&view=rev Log: More changes to plotting for statistics. Task #7826 (https://gna.org/task/index.php?7826): Write an python class for the repeated analysis of dispersion data. Modified: trunk/auto_analyses/relax_disp_repeat_cpmg.py Modified: trunk/auto_analyses/relax_disp_repeat_cpmg.py URL: http://svn.gna.org/viewcvs/relax/trunk/auto_analyses/relax_disp_repeat_cpmg.py?rev=25852&r1=25851&r2=25852&view=diff ============================================================================== --- trunk/auto_analyses/relax_disp_repeat_cpmg.py (original) +++ trunk/auto_analyses/relax_disp_repeat_cpmg.py Tue Sep 16 02:03:38 2014 @@ -1272,11 +1272,15 @@ # Loop over the methods. # Define figure - #fig = plt.figure(figsize=(12, 12)) - fig = plt.figure() + fig, axises = plt.subplots(nrows=2, ncols=1) fig.suptitle('Stats per NI') - ax1 = fig.add_subplot(111) - ax2 = ax1.twinx() + ax1, ax2 = axises + + min_a = 1.0 + max_a = 0.0 + + min_r_xy2 = 1.0 + max_r_xy2 = 0.0 for method in methods: if method not in r2eff_stat_dic: @@ -1288,26 +1292,36 @@ # Linear regression slope, without intercept a = r2eff_stat_dic[method]['a'] + if max(a) > max_a: + max_a = max(a) + if min(a) > min_a: + min_a = min(a) + # sample correlation coefficient, without intercept r_xy = r2eff_stat_dic[method]['r_xy'] r_xy2 = r_xy**2 + if max(r_xy2) > max_r_xy2: + max_r_xy2 = max(r_xy2) + if min(r_xy2) > min_r_xy2: + min_r_xy2 = min(r_xy2) + ax1.plot(x, a, ".-", label='%s LR'%method) ax2.plot(x, r_xy2, "o--", label='%s SC'%method) - #ax1.legend(loc='upper left', shadow=True) ax1.legend(loc='lower left', shadow=True, prop = fontP) - ax2.legend(loc='lower right', shadow=True, prop = fontP) ax1.set_xlabel('NI') #ax1.set_ylabel(r'$\sigma ( R_{2,\mathrm{eff}} )$') ax1.set_ylabel('Linear regression slope, without intercept') + ax1.set_xticks(x) + ax1.set_ylim(0.8, max_a*1.05) + ax1.invert_xaxis() + + ax2.legend(loc='lower right', shadow=True, prop = fontP) ax2.set_ylabel('Sample correlation ' + r'$r_{xy}^2$') - ax1.set_xticks(x) ax2.set_xticks(x) - #ax1.set_ylim(0, 1.1) - ax2.set_ylim(0, 1.0) - ax1.invert_xaxis() - #ax2.invert_xaxis() + ax2.set_ylim(0.8, max_r_xy2*1.05) + ax2.invert_xaxis() if show: plt.show()