Author: bugman
Date: Fri Jan 16 17:32:50 2015
New Revision: 27196
URL: http://svn.gna.org/viewcvs/relax?rev=27196&view=rev
Log:
Improvements for the plots created by the pcs.corr_plot user function.
The axes now have labels, and have the range and number of ticks set to
reasonable values.
Modified:
trunk/pipe_control/pcs.py
Modified: trunk/pipe_control/pcs.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pcs.py?rev=27196&r1=27195&r2=27196&view=diff
==============================================================================
--- trunk/pipe_control/pcs.py (original)
+++ trunk/pipe_control/pcs.py Fri Jan 16 17:32:50 2015
@@ -342,11 +342,15 @@
spin_to.pcs_err[align_id] = spin_from.pcs_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 PCSs.
@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).
@@ -368,6 +372,10 @@
# Init.
data = []
+ orig_title = title
+ if orig_title == None:
+ title = "PCS correlation plot"
+ axis_labels = ["Back-calculated PCS (ppm)", "Measured PCS (ppm)"]
# The diagonal.
data.append([[-100, -100, 0], [100, 100, 0]])
@@ -445,10 +453,10 @@
set_names.append("%s (%s)" % (cdp.pcs_ids[i], types[j]))
# The header.
- grace.write_xy_header(file=file, title="PCS correlation plot",
data_type=['pcs_bc', 'pcs'], sets=[size], set_names=[set_names],
linestyle=[[2]+[0]*size], legend_pos=[[1, 0.5]])
+ grace.write_xy_header(file=file, title=title, subtitle=subtitle,
world=[[-10, -10, 10, 10]], sets=[size], set_names=[set_names],
linestyle=[[2]+[0]*size], data_type=['pcs_bc', 'pcs'],
axis_labels=[axis_labels], tick_major_spacing=[[1, 1]], 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)
+ grace.write_xy_data(data=data, file=file, graph_type=graph_type,
autoscale=False)
def delete(align_id=None):
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits