mailr23169 - in /trunk: pipe_control/rdc.py user_functions/rdc.py


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

Header


Content

Posted by edward on May 14, 2014 - 11:31:
Author: bugman
Date: Wed May 14 11:31:28 2014
New Revision: 23169

URL: http://svn.gna.org/viewcvs/relax?rev=23169&view=rev
Log:
Added the 'title' and 'subtitle' arguments to the rdc.corr_plot user function.

This allows the defaults to be overridden with user supplied titles and 
subtitles.


Modified:
    trunk/pipe_control/rdc.py
    trunk/user_functions/rdc.py

Modified: trunk/pipe_control/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/rdc.py?rev=23169&r1=23168&r2=23169&view=diff
==============================================================================
--- trunk/pipe_control/rdc.py   (original)
+++ trunk/pipe_control/rdc.py   Wed May 14 11:31:28 2014
@@ -375,11 +375,15 @@
                 interatom_to.rdc_err[align_id] = 
interatom_from.rdc_err[align_id]
 
 
-def corr_plot(format=None, file=None, dir=None, force=False):
+def corr_plot(format=None, title=None, subtitle=None, file=None, dir=None, 
force=False):
     """Generate a correlation plot of the measured vs. back-calculated RDCs.
 
     @keyword format:    The format for the plot file.  The following values 
are accepted: 'grace', a Grace plot; None, a plain text file.
     @type format:       str or None
+    @keyword title:     The title for the plot, overriding the default.
+    @type title:        None or str
+    @keyword subtitle:  The subtitle for the plot, overriding the default.
+    @type subtitle:     None or str
     @keyword file:      The file name or object to write to.
     @type file:         str or file object
     @keyword dir:       The name of the directory to place the file into 
(defaults to the current directory).
@@ -401,7 +405,9 @@
 
     # Init.
     data = []
-    title = "RDC correlation plot"
+    orig_title = title
+    if orig_title == None:
+        title = "RDC correlation plot"
     axis_labels = ["Measured RDC (Hz)", "Back-calculated RDC (Hz)"]
 
     # The diagonal.
@@ -438,7 +444,8 @@
                     rdc -= interatom.j_coupling
 
                 # A different title and axis labels.
-                title = "T = J+D correlation plot"
+                if orig_title == None:
+                    title = "T = J+D correlation plot"
                 axis_labels = ["Measured T = J+D (Hz)", "Back-calculated T = 
J+D (Hz)"]
 
             # Append the data.
@@ -469,7 +476,7 @@
     # Grace file.
     if format == 'grace':
         # The header.
-        grace.write_xy_header(file=file, title=title, world=[[-50, -50, 50, 
50]], sets=[size], set_names=[[None]+cdp.rdc_ids], linestyle=[[2]+[0]*size], 
data_type=['rdc', 'rdc_bc'], axis_labels=[axis_labels], 
tick_major_spacing=[[10, 10]], tick_minor_count=[[9, 9]], legend_pos=[[1, 
0.5]])
+        grace.write_xy_header(file=file, title=title, subtitle=subtitle, 
world=[[-50, -50, 50, 50]], sets=[size], set_names=[[None]+cdp.rdc_ids], 
linestyle=[[2]+[0]*size], data_type=['rdc', 'rdc_bc'], 
axis_labels=[axis_labels], tick_major_spacing=[[10, 10]], 
tick_minor_count=[[9, 9]], legend_pos=[[1, 0.5]])
 
         # The main data.
         grace.write_xy_data(data=data, file=file, graph_type=graph_type, 
autoscale=False)

Modified: trunk/user_functions/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/rdc.py?rev=23169&r1=23168&r2=23169&view=diff
==============================================================================
--- trunk/user_functions/rdc.py (original)
+++ trunk/user_functions/rdc.py Wed May 14 11:31:28 2014
@@ -164,6 +164,20 @@
     can_be_none = True
 )
 uf.add_keyarg(
+    name = "title",
+    py_type = "str",
+    desc_short = "alternative plot title",
+    desc = "The title for the plot, overriding the default.",
+    can_be_none = True
+)
+uf.add_keyarg(
+    name = "subtitle",
+    py_type = "str",
+    desc_short = "alternative plot subtitle",
+    desc = "The subtitle for the plot, overriding the default.",
+    can_be_none = True
+)
+uf.add_keyarg(
     name = "file",
     default = "rdc_corr_plot.agr",
     py_type = "str",
@@ -200,7 +214,7 @@
 uf.desc[-1].add_prompt("relax> rdc.corr_plot(format=None)")
 uf.backend = rdc.corr_plot
 uf.menu_text = "corr_&plot"
-uf.wizard_size = (800, 500)
+uf.wizard_size = (900, 600)
 uf.wizard_image = WIZARD_IMAGE_PATH + 'align_tensor.png'
 uf.wizard_apply_button = False
 




Related Messages


Powered by MHonArc, Updated Wed May 14 11:40:02 2014