3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * Gromacs Runs On Most of All Computer Systems
51 /***************************************************
53 ***************************************************/
55 elNone
, elSolid
, elDotted
, elDashed
,
56 elLongDashed
, elDotDashed
, elNR
58 /* xvgr line-styles */
61 ecWhite
, ecFrank
, ecBlack
=ecFrank
,
62 ecRed
, ecGreen
, ecBlue
, ecYellow
, ecBrown
, ecGray
,
63 ecPurple
, ecLightBlue
, ecViolet
, ecHolland
, ecLila
, ecDarkGray
,
64 ecAquamarine
, ecOlive
, ecNR
66 /* xvgr line-colors */
69 eppNone
, eppColor
, eppPattern
, eppNR
71 /* xvgr pattern type */
78 /***************************************************
80 ***************************************************/
82 extern bool use_xmgr(void);
83 /* Returns if we use xmgr instead of xmgrace */
85 extern FILE *xvgropen(const char *fn
,const char *title
,const char *xaxis
,
86 const char *yaxis
,const output_env_t oenv
);
87 /* Open a file, and write a title, and axis-labels in Xvgr format */
89 /* Close xvgr file, and clean up internal file buffers correctly */
90 extern void xvgrclose(FILE *fp
);
92 extern void xvgr_subtitle(FILE *out
,const char *subtitle
,
93 const output_env_t oenv
);
94 /* Set the subtitle in xvgr */
96 extern void xvgr_view(FILE *out
,real xmin
,real ymin
,real xmax
,real ymax
,
97 const output_env_t oenv
);
98 /* Set the view in xvgr */
100 extern void xvgr_world(FILE *out
,real xmin
,real ymin
,real xmax
,real ymax
,
101 const output_env_t oenv
);
102 /* Set the world in xvgr */
104 extern void xvgr_legend(FILE *out
,int nsets
,char **setnames
,
105 const output_env_t oenv
);
106 /* Make a legend box, and also modifies the view to make room for the legend */
108 extern void xvgr_line_props(FILE *out
,int NrSet
,int LineStyle
,int LineColor
,
109 const output_env_t oenv
);
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
,
117 const output_env_t oenv
);
120 extern int read_xvg_legend(const char *fn
,double ***y
,int *ny
,char ***legend
);
121 /* Read an xvg file for post processing. The number of rows is returned
122 * fn is the filename, y is a pointer to a 2D array (to be allocated by
123 * the routine) ny is the number of columns (including X if appropriate).
124 * If legend!=NULL, read the legends for the sets (when present),
125 * 0 is the first y legend, the legend string will be NULL when not present.
128 extern int read_xvg(const char *fn
,double ***y
,int *ny
);
129 /* As read_xvg_legend, but does not read legends. */
131 extern void write_xvg(const char *fn
,const char *title
,int nx
,int ny
,real
**y
,
132 char **leg
, const output_env_t oenv
);
133 /* Write a two D array (y) of dimensions nx rows times
134 * ny columns to a file. If leg != NULL it will be written too.
138 /* This function reads ascii (xvg) files and extracts the data sets to a
139 * two dimensional array which is returned.
141 extern real
**read_xvg_time(const char *fn
,
145 int nsets_in
,int *nset
,int *nval
,