File: plot.h

package info (click to toggle)
lorene 0.0.0~cvs20161116%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 26,444 kB
  • ctags: 13,953
  • sloc: cpp: 212,946; fortran: 21,645; makefile: 1,750; sh: 4
file content (175 lines) | stat: -rw-r--r-- 6,525 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
 * Declaration of elementary graphical functions
 */

/*
 *   Copyright (c) 2005 Eric Gourgoulhon
 *
 *   This file is part of LORENE.
 *
 *   LORENE is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   LORENE is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with LORENE; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

/*
 * $Id: plot.h,v 1.1 2005/11/14 01:57:00 e_gourgoulhon Exp $
 * $Log: plot.h,v $
 * Revision 1.1  2005/11/14 01:57:00  e_gourgoulhon
 * First version
 *
 *
 * $Header: /cvsroot/Lorene/School05/Monday/plot.h,v 1.1 2005/11/14 01:57:00 e_gourgoulhon Exp $
 *
 */

#ifndef __PLOT_H_ 
#define __PLOT_H_ 

/**
 * \defgroup graphbasic Basic graphical routines.
 * Different figures can created simultaneously. They are characterized
 * by the label \c nfig. 
 *
 * @{
 */

/** Drawing a point as a small circle. 
 *
 *  @param x point abscissa
 *  @param y point ordinate
 *  @param color color of the small circle: \anchor color_list
 *      \li 0 : black (background)
 *      \li 1 : white (default)
 *      \li 2 : red
 *      \li 3 : green
 *      \li 4 : blue
 *      \li 5 : cyan
 *      \li 6 : magenta
 *      \li 7 : yellow
 *      \li 8 : orange
 *      \li 9 : green + yellow
 *      \li 10 : green + cyan
 *      \li 11 : blue + cyan
 *      \li 12 : blue + magenta
 *      \li 13 : red + magenta
 *      \li 14 : dark gray 
 *      \li 15 : light gray
 *  @param nfig index of the figure (in the range [0,99])
 *  to be used for the plot: if this figure does not exist, 
 *    it will be created with the device name \c device  provided by the last
 *      argument. 
 *  @param ymin lower bound on y of the graphical window (used only if a new 
 *      figure must be created)
 *  @param ymax upper bound on y of the graphical window (used only if a new 
 *      figure must be created)
 *  @param title title of the figure (used only if a new figure must be created)
 *  @param label_y y legend of the figure (used only if a new 
 *      figure must be created)
 *  @param device type of graphical device (default value = 0x0, will result in
 *  interactive choice) (used only if a new 
 *      figure must be created)
 */
void plot_point(double x, double y, int color = 1, int nfig = 0, 
                double ymin = -1., double ymax = 1., const char* title = 0x0, 
                const char* label_y = 0x0, const char* device = 0x0) ;

/** Drawing a set of points as small circles. 
 *
 *  @param np Number of points
 *  @param xx Array (size: \c np ) of abscissas of the points
 *  @param yy Array (size: \c np ) of ordinates of the points
 *  @param color color of the small circles: see \ref color_list 
 *  @param nfig index of the figure (in the range [0,99])
 *  to be used for the plot: if this figure does not exist, 
 *    it will be created with the device name \c device  provided by the last
 *      argument. 
 *  @param ymin lower bound on y of the graphical window (used only if a new 
 *      figure must be created)
 *  @param ymax upper bound on y of the graphical window (used only if a new 
 *      figure must be created)
 *  @param title title of the figure (used only if a new figure must be created)
 *  @param label_y y legend of the figure (used only if a new 
 *      figure must be created)
 *  @param device type of graphical device (default value = 0x0, will result in
 *  interactive choice) (used only if a new 
 *      figure must be created)
 */
void plot_point_set(int np, const double* xx, const double* yy, int color = 1, 
                    int nfig = 0, double ymin = -1., double ymax = 1., 
                  const char* title = 0x0, const char* label_y = 0x0, 
                  const char* device = 0x0) ;

/** Drawing a profile with uniform x sampling.
 *  A profile is a curve y=y(x). It is drawn on the specified figure. If the 
 *  latter is not opened, it will be opened with the device name \c device  
 *  provided by the last argument. 
 *
 *  @param yy Array (size: \c nx ) of y values to be drawn
 *			 (the x sampling is supposed to be uniform in [-1,1]).
 *  @param nx Number of points 
 *  @param color color of the profile: see \ref color_list 
 *  @param style style of the profile:
 *       the possible values are \c line_style[i] = 1  
 * (full line), 2 (dashed), 3 (dot-dash-dot-dash), 4 (dotted), 5 
 * (dash-dot-dot-dot).  
 *  @param nfig index of the figure (in the range [0,99])
 *  to be used for the plot: if this figure does not exist, 
 *    it will be created with the device name \c device  provided by the last
 *      argument. 
 *  @param ymin lower bound on y of the graphical window (used only if a new 
 *      figure must be created)
 *  @param ymax upper bound on y of the graphical window (used only if a new 
 *      figure must be created)
 *  @param title title of the figure (used only if a new figure must be created)
 *  @param label_y y legend of the figure (used only if a new 
 *      figure must be created)
 *  @param device type of graphical device (default value = 0x0, will result in
 *  interactive choice) (used only if a new 
 *      figure must be created)
 */
void plot_profile(const double* yy, int nx, int color = 1, int style = 1,    
                  int nfig = 0, double ymin = -1., double ymax = 1., 
                  const char* title = 0x0, const char* label_y = 0x0, 
                  const char* device = 0x0) ;

/** Closing a figure.
  *
  *  @param nfig [input] Index of the figure (in the range [0,99])
  * 
  */
void plot_close(int nfig = 0) ;

/** Closing all opened figures.
  *
  */
void plot_close_all() ;


/** @} */

/** Initialization of the graphical displays.
 * This function is called only by the other graphical routines
 * and is required if the graphical engine is PGPLOT.
 */
void plot_init() ; 

/** Opening a figure. 
 *  To be called only by the other graphical routines
 *
 */
void plot_open(int nfig, double ymin, double ymax, const char* title,    
    const char* label_y, const char* device) ; 

#endif