4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * GRoups of Organic Molecules in ACtion for Science
40 static char *SRCID_xvgr_h = "$Id$";
46 #ident "@(#) xvgr.h 1.8 7/28/97"
47 #endif /* HAVE_IDENT */
57 /***************************************************
59 ***************************************************/
61 elNone, elSolid, elDotted, elDashed,
62 elLongDashed, elDotDashed, elNR
64 /* xvgr line-styles */
67 ecWhite, ecFrank, ecBlack=ecFrank,
68 ecRed, ecGreen, ecBlue, ecYellow, ecBrown, ecGray,
69 ecPurple, ecLightBlue, ecViolet, ecHolland, ecLila, ecDarkGray,
70 ecAquamarine, ecOlive, ecNR
72 /* xvgr line-colors */
75 eppNone, eppColor, eppPattern, eppNR
77 /* xvgr pattern type */
84 /***************************************************
86 ***************************************************/
88 extern FILE *xvgropen(char *fn,char *title,char *xaxis,char *yaxis);
89 /* Open a file, and write a title, and axis-labels in Xvgr format */
91 /*extern void xvgr_file(char *fn,char *opts);*/
92 /* ! - - - DEPRECATED - - - !
93 * use do_view now instead!
94 * optional support for xmgrace now via env. GMX_VIEW_XVG
95 * see viewit.c/.h (gmxlib)
96 * Starts xvgr with a file fn in the background,
97 * opts (options to xvgr) may be NULL
100 extern void xvgr_view(FILE *out,real xmin,real ymin,real xmax,real ymax);
101 /* Set the view in xvgr */
103 extern void xvgr_world(FILE *out,real xmin,real ymin,real xmax,real ymax);
104 /* Set the world in xvgr */
106 extern void xvgr_legend(FILE *out,int nsets,char *setname[]);
107 /* Make a legend box, and also modifies the view to make room for the legend */
109 extern void xvgr_line_props(FILE *out,int NrSet,int LineStyle,int LineColor);
110 /* Set xvgr line styles and colors */
112 extern void xvgr_box(FILE *out,
114 real xmin,real ymin,real xmax,real ymax,
115 int LineStyle,int LineWidth,int LineColor,
116 int BoxFill,int BoxColor,int BoxPattern);
119 extern int read_xvg(char *fn,real ***y,int *ny);
120 /* Read an xvg file for post processing. The number of rows is returned
121 * fn is the filename, y is a pointer to a 2D array (to be allocated by
122 * the routine) ny is the number of columns (including X if appropriate)
125 extern void write_xvg(char *fn,char *title,int nx,int ny,real **y,char **leg);
126 /* Write a two D array (y) of dimensions nx rows times
127 * ny columns to a file. If leg != NULL it will be written too.
130 /****************************************************
131 * Some statistics utilities
132 ****************************************************/
133 extern void lsq_y_ax(int n, real x[], real y[], real *a);
134 /* Fit a straight line y=ax thru the n data points x,y. */
136 extern real lsq_y_ax_b(int n, real x[], real y[], real *a, real *b);
137 /* Fit a straight line y=ax+b thru the n data points x,y.
138 * Returns the "fit quality" sigma = sqrt(chi^2/(n-2)).