mailr25712 - in /trunk: auto_analyses/relax_disp_repeat_cpmg.py test_suite/system_tests/relax_disp.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on September 09, 2014 - 13:00:
Author: tlinnet
Date: Tue Sep  9 13:00:39 2014
New Revision: 25712

URL: http://svn.gna.org/viewcvs/relax?rev=25712&view=rev
Log:
Small improvement of the matplotlib plotting of data in the repeated analysis 
protocol.

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
    trunk/test_suite/system_tests/relax_disp.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=25712&r1=25711&r2=25712&view=diff
==============================================================================
--- trunk/auto_analyses/relax_disp_repeat_cpmg.py       (original)
+++ trunk/auto_analyses/relax_disp_repeat_cpmg.py       Tue Sep  9 13:00:39 
2014
@@ -48,7 +48,10 @@
 from status import Status; status = Status()
 
 if dep_check.matplotlib_module:
-    import matplotlib.pyplot as plt
+    import pylab as plt
+    from matplotlib.font_manager import FontProperties
+    fontP = FontProperties()
+    fontP.set_size('small')
 
 
 # Define sfrq key to dic.
@@ -983,6 +986,13 @@
     def plot_r2eff_stat(self, r2eff_stat_dic=None, methods=[], 
list_glob_ini=[], show=False):
 
         # Loop over the methods.
+
+        # Define figure
+        #fig = plt.figure(figsize=(12, 12))
+        fig = plt.figure()
+        ax1 = fig.add_subplot(111)
+        #ax2 = ax1.twinx()
+
         for method in methods:
             if method not in r2eff_stat_dic:
                 continue
@@ -990,13 +1000,20 @@
             if not dep_check.matplotlib_module:
                 continue
 
-            fig = plt.figure()
+
             x = r2eff_stat_dic[method]['glob_ini']
             y = r2eff_stat_dic[method]['r2eff_norm_std']
-            plt.plot(x, y)
-
-            if show:
-                plt.show()
+
+            ax1.plot(x, y, label='%s'%method)
+
+        #ax1.legend(loc='upper left', shadow=True)
+        ax1.legend(loc='upper left', shadow=True, prop = fontP)
+        ax1.set_xlabel('NI')
+        ax1.set_ylabel(r'$\sigma ( R_{2,\mathrm{eff}} )$')
+        fig.gca().set_xticks(x)
+        fig.gca().invert_xaxis()
+        if show:
+            plt.show()
 
 
     def interpreter_start(self):

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=25712&r1=25711&r2=25712&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Tue Sep  9 13:00:39 2014
@@ -5974,7 +5974,7 @@
 
             if True:
                 # Collect r2eff values.
-                r2eff_ft = RDR.col_r2eff(method='FT', list_glob_ini=[128, 
126, 6])
+                r2eff_ft = RDR.col_r2eff(method='FT', list_glob_ini=[128, 
126])
 
                 # Collect r2eff values.
                 r2eff_mdd = RDR.col_r2eff(method='MDD', list_glob_ini=[128, 
126])
@@ -5983,7 +5983,7 @@
                 r2eff_stat_dic = 
RDR.get_r2eff_stat_dic(list_r2eff_dics=[r2eff_ft, r2eff_mdd], 
list_glob_ini=[128, 126, 6])
 
                 # Plot R2eff stats
-                RDR.plot_r2eff_stat(r2eff_stat_dic=r2eff_stat_dic, 
methods=['FT'], list_glob_ini=[128, 126, 6], show=False)
+                RDR.plot_r2eff_stat(r2eff_stat_dic=r2eff_stat_dic, 
methods=['FT', 'MDD'], list_glob_ini=[128, 126, 6], show=False)
 
         # Do minimisation
         if False:




Related Messages


Powered by MHonArc, Updated Tue Sep 09 14:40:02 2014