Removing scripts and introducing wrapper binaries instead.
[gromacs.git] / include / xvgr.h
blob92941738eb1d31af708534d39a2593862ff0a9ea
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 3.2.0
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
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 * For more info, check our website at http://www.gromacs.org
33 * And Hey:
34 * Gromacs Runs On Most of All Computer Systems
37 #ifndef _xvgr_h
38 #define _xvgr_h
40 #ifdef HAVE_CONFIG_H
41 #include <config.h>
42 #endif
44 #ifdef CPLUSPLUS
45 extern "C" {
46 #endif
48 #include "sysstuff.h"
49 #include "typedefs.h"
50 #include "viewit.h"
52 /***************************************************
53 * XVGR DEFINITIONS
54 ***************************************************/
55 enum {
56 elNone, elSolid, elDotted, elDashed,
57 elLongDashed, elDotDashed, elNR
59 /* xvgr line-styles */
61 enum {
62 ecWhite, ecFrank, ecBlack=ecFrank,
63 ecRed, ecGreen, ecBlue, ecYellow, ecBrown, ecGray,
64 ecPurple, ecLightBlue, ecViolet, ecHolland, ecLila, ecDarkGray,
65 ecAquamarine, ecOlive, ecNR
67 /* xvgr line-colors */
69 enum {
70 eppNone, eppColor, eppPattern, eppNR
72 /* xvgr pattern type */
74 enum {
75 evView, evWorld, evNR
77 /* view type */
79 /***************************************************
80 * XVGR ROUTINES
81 ***************************************************/
83 extern FILE *xvgropen(const char *fn,const char *title,const char *xaxis,const char *yaxis);
84 /* Open a file, and write a title, and axis-labels in Xvgr format */
86 extern void xvgr_view(FILE *out,real xmin,real ymin,real xmax,real ymax);
87 /* Set the view in xvgr */
89 extern void xvgr_world(FILE *out,real xmin,real ymin,real xmax,real ymax);
90 /* Set the world in xvgr */
92 extern void xvgr_legend(FILE *out,int nsets,char *setname[]);
93 /* Make a legend box, and also modifies the view to make room for the legend */
95 extern void xvgr_line_props(FILE *out,int NrSet,int LineStyle,int LineColor);
96 /* Set xvgr line styles and colors */
98 extern void xvgr_box(FILE *out,
99 int LocType,
100 real xmin,real ymin,real xmax,real ymax,
101 int LineStyle,int LineWidth,int LineColor,
102 int BoxFill,int BoxColor,int BoxPattern);
103 /* Make a box */
105 extern int read_xvg(const char *fn,real ***y,int *ny);
106 /* Read an xvg file for post processing. The number of rows is returned
107 * fn is the filename, y is a pointer to a 2D array (to be allocated by
108 * the routine) ny is the number of columns (including X if appropriate)
111 extern void write_xvg(char *fn,char *title,int nx,int ny,real **y,char **leg);
112 /* Write a two D array (y) of dimensions nx rows times
113 * ny columns to a file. If leg != NULL it will be written too.
116 /****************************************************
117 * Some statistics utilities
118 ****************************************************/
119 extern void lsq_y_ax(int n, real x[], real y[], real *a);
120 /* Fit a straight line y=ax thru the n data points x,y. */
122 extern real lsq_y_ax_b(int n, real x[], real y[], real *a, real *b);
123 /* Fit a straight line y=ax+b thru the n data points x,y.
124 * Returns the "fit quality" sigma = sqrt(chi^2/(n-2)).
127 #ifdef CPLUSPLUS
129 #endif
131 #endif /* _xvgr_h */