Author: bugman Date: Fri Feb 6 14:47:10 2015 New Revision: 27596 URL: http://svn.gna.org/viewcvs/relax?rev=27596&view=rev Log: Converted all of the Grace plotting in relax to use the plotting API of the relax library. Modified: trunk/pipe_control/grace.py trunk/pipe_control/pcs.py trunk/specific_analyses/relax_disp/data.py Modified: trunk/pipe_control/grace.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/grace.py?rev=27596&r1=27595&r2=27596&view=diff ============================================================================== --- trunk/pipe_control/grace.py (original) +++ trunk/pipe_control/grace.py Fri Feb 6 14:47:10 2015 @@ -29,7 +29,7 @@ # relax module imports. from lib.errors import RelaxError, RelaxNoSequenceError, RelaxNoSimError from lib.io import get_file_path, open_write_file, test_binary -from lib.plotting.grace import write_xy_data, write_xy_header +from lib.plotting.api import write_xy_data, write_xy_header from lib.warnings import RelaxWarning from pipe_control.mol_res_spin import count_molecules, count_residues, count_spins, exists_mol_res_spin_data from pipe_control import pipes @@ -271,10 +271,10 @@ seq_type, axis_labels = axis_setup(data_type=data_type, norm=norm) # Write the header. - write_xy_header(file=file, data_type=data_type, seq_type=seq_type, sets=[len(data[0])], set_names=[set_names], axis_labels=[axis_labels], norm=[norm]) + write_xy_header(format='grace', file=file, data_type=data_type, seq_type=seq_type, sets=[len(data[0])], set_names=[set_names], axis_labels=[axis_labels], norm=[norm]) # Write the data. - write_xy_data(data, file=file, graph_type=graph_type, norm_type=norm_type, norm=[norm]) + write_xy_data(format='grace', data=data, file=file, graph_type=graph_type, norm_type=norm_type, norm=[norm]) # Close the file. file.close() Modified: trunk/pipe_control/pcs.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pcs.py?rev=27596&r1=27595&r2=27596&view=diff ============================================================================== --- trunk/pipe_control/pcs.py (original) +++ trunk/pipe_control/pcs.py Fri Feb 6 14:47:10 2015 @@ -38,7 +38,7 @@ from lib.io import open_write_file from lib.periodic_table import periodic_table from lib.physical_constants import pcs_constant -from lib.plotting import grace +from lib.plotting.api import write_xy_data, write_xy_header from lib.sequence import read_spin_data, write_spin_data from lib.warnings import RelaxWarning, RelaxNoSpinWarning from pipe_control import pipes @@ -474,10 +474,10 @@ set_names.append("%s (%s)" % (cdp.pcs_ids[i], types[j])) # The header. - grace.write_xy_header(file=file, title=title, subtitle=subtitle, world=[[min_pcs, min_pcs, max_pcs, max_pcs]], 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]]) + write_xy_header(format=format, file=file, title=title, subtitle=subtitle, world=[[min_pcs, min_pcs, max_pcs, max_pcs]], 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, autoscale=False) + write_xy_data(format=format, data=data, file=file, graph_type=graph_type, autoscale=False) def delete(align_id=None): Modified: trunk/specific_analyses/relax_disp/data.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/data.py?rev=27596&r1=27595&r2=27596&view=diff ============================================================================== --- trunk/specific_analyses/relax_disp/data.py (original) +++ trunk/specific_analyses/relax_disp/data.py Fri Feb 6 14:47:10 2015 @@ -67,7 +67,8 @@ from lib.io import extract_data, get_file_path, open_write_file, strip, write_data from lib.nmr import frequency_to_ppm, frequency_to_ppm_from_rad, frequency_to_rad_per_s, rotating_frame_params from lib.periodic_table import periodic_table -from lib.plotting.grace import write_xy_data, write_xy_header, script_grace2images +from lib.plotting.api import write_xy_data, write_xy_header +from lib.plotting.grace import script_grace2images from lib.sequence import read_spin_data, write_spin_data from lib.text.sectioning import section from lib.warnings import RelaxWarning, RelaxNoSpinWarning @@ -2124,13 +2125,13 @@ sets.append(len(data[gi])) legend.append(False) legend[0] = True - write_xy_header(file=file, title=title, subtitle=subtitle, graph_num=graph_num, sets=sets, set_names=set_labels, set_colours=set_colours, x_axis_type_zero=x_axis_type_zero, symbols=symbols, symbol_sizes=symbol_sizes, linetype=linetype, linestyle=linestyle, axis_labels=axis_labels, legend=legend, legend_box_fill_pattern=[0]*graph_num, legend_char_size=[0.8]*graph_num) + write_xy_header(format='grace', file=file, title=title, subtitle=subtitle, graph_num=graph_num, sets=sets, set_names=set_labels, set_colours=set_colours, x_axis_type_zero=x_axis_type_zero, symbols=symbols, symbol_sizes=symbol_sizes, linetype=linetype, linestyle=linestyle, axis_labels=axis_labels, legend=legend, legend_box_fill_pattern=[0]*graph_num, legend_char_size=[0.8]*graph_num) # Write the data. graph_type = 'xy' if err: graph_type = 'xydy' - write_xy_data(data, file=file, graph_type=graph_type) + write_xy_data(format='grace', data=data, file=file, graph_type=graph_type) # Close the file. file.close()