Author: bugman Date: Sun Nov 24 15:50:13 2013 New Revision: 21622 URL: http://svn.gna.org/viewcvs/relax?rev=21622&view=rev Log: Merged revisions 21621 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r21621 | bugman | 2013-11-24 15:48:54 +0100 (Sun, 24 Nov 2013) | 3 lines The lib.software.grace module now supports setting the X and Y axes at zero. ........ Modified: branches/relax_disp/ (props changed) branches/relax_disp/lib/software/grace.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Sun Nov 24 15:50:13 2013 @@ -1,1 +1,1 @@ -/trunk:1-21613 +/trunk:1-21621 Modified: branches/relax_disp/lib/software/grace.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/software/grace.py?rev=21622&r1=21621&r2=21622&view=diff ============================================================================== --- branches/relax_disp/lib/software/grace.py (original) +++ branches/relax_disp/lib/software/grace.py Sun Nov 24 15:50:13 2013 @@ -222,7 +222,7 @@ file.write("@arrange(%i, %i, .1, .1, .1, OFF, OFF, OFF)\n" % (row_num, col_num)) -def write_xy_header(file=None, paper_size='A4', title=None, subtitle=None, view=None, graph_num=1, sets=1, set_names=None, set_colours=None, symbols=None, symbol_sizes=None, symbol_fill=None, linestyle=None, linetype=None, linewidth=None, data_type=None, seq_type=None, axis_labels=None, legend=None, legend_pos=None, legend_box_fill_pattern=None, legend_char_size=None, norm=None): +def write_xy_header(file=None, paper_size='A4', title=None, subtitle=None, view=None, graph_num=1, sets=1, set_names=None, set_colours=None, x_axis_type_zero=None, y_axis_type_zero=None, symbols=None, symbol_sizes=None, symbol_fill=None, linestyle=None, linetype=None, linewidth=None, data_type=None, seq_type=None, axis_labels=None, legend=None, legend_pos=None, legend_box_fill_pattern=None, legend_char_size=None, norm=None): """Write the grace header for xy-scatter plots. Many of these keyword arguments should be supplied in a [X, Y] list format, where the first element corresponds to the X data, and the second the Y data. Defaults will be used for any non-supplied args (or lists with elements set to None). @@ -246,6 +246,10 @@ @type set_names: None or list of list of str @keyword set_colours: The colours for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. @type set_colours: None or list of list of int + @keyword x_axis_type_zero: The flags specifying if the X-axis should be placed at zero. + @type x_axis_type_zero: None or list of lists of bool + @keyword y_axis_type_zero: The flags specifying if the Y-axis should be placed at zero. + @type y_axis_type_zero: None or list of lists of bool @keyword symbols: The symbol style for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. @type symbols: None or list of list of int @keyword symbol_sizes: The symbol size for each graph data set Gx.Sy. The first dimension is the graph, the second is the set. @@ -281,6 +285,14 @@ sets = [] for gi in range(graph_num): sets.append(1) + if x_axis_type_zero == None: + x_axis_type_zero = [] + for gi in range(graph_num): + x_axis_type_zero.append(False) + if y_axis_type_zero == None: + y_axis_type_zero = [] + for gi in range(graph_num): + y_axis_type_zero.append(False) if linewidth == None: linewidth = [] for gi in range(graph_num): @@ -330,6 +342,12 @@ file.write("@ title \"%s\"\n" % title) if subtitle: file.write("@ subtitle \"%s\"\n" % subtitle) + + # Axis at zero. + if x_axis_type_zero[gi]: + file.write("@ xaxis type zero true\n") + if y_axis_type_zero[gi]: + file.write("@ yaxis type zero true\n") # Axis specific settings. axes = ['x', 'y']