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
,const char *yaxis
);
86 /* Open a file, and write a title, and axis-labels in Xvgr format */
88 /* Close xvgr file, and clean up internal file buffers correctly */
89 extern void xvgrclose(FILE *fp
);
91 extern void xvgr_subtitle(FILE *out
,const char *subtitle
);
92 /* Set the subtitle in xvgr */
94 extern void xvgr_view(FILE *out
,real xmin
,real ymin
,real xmax
,real ymax
);
95 /* Set the view in xvgr */
97 extern void xvgr_world(FILE *out
,real xmin
,real ymin
,real xmax
,real ymax
);
98 /* Set the world in xvgr */
100 extern void xvgr_legend(FILE *out
,int nsets
,char **setnames
);
101 /* Make a legend box, and also modifies the view to make room for the legend */
103 extern void xvgr_line_props(FILE *out
,int NrSet
,int LineStyle
,int LineColor
);
104 /* Set xvgr line styles and colors */
106 extern void xvgr_box(FILE *out
,
108 real xmin
,real ymin
,real xmax
,real ymax
,
109 int LineStyle
,int LineWidth
,int LineColor
,
110 int BoxFill
,int BoxColor
,int BoxPattern
);
113 extern int read_xvg_legend(const char *fn
,double ***y
,int *ny
,char ***legend
);
114 /* Read an xvg file for post processing. The number of rows is returned
115 * fn is the filename, y is a pointer to a 2D array (to be allocated by
116 * the routine) ny is the number of columns (including X if appropriate).
117 * If legend!=NULL, read the legends for the sets (when present),
118 * 0 is the first y legend, the legend string will be NULL when not present.
121 extern int read_xvg(const char *fn
,double ***y
,int *ny
);
122 /* As read_xvg_legend, but does not read legends. */
124 extern void write_xvg(const char *fn
,const char *title
,int nx
,int ny
,real
**y
,
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.
131 /* This function reads ascii (xvg) files and extracts the data sets to a
132 * two dimensional array which is returned.
134 extern real
**read_xvg_time(char *fn
,
138 int nsets_in
,int *nset
,int *nval
,