dae1cc07a1adcb30dd81f58b48eaec53d1874292
[pspp-builds.git] / src / output / charts / plot-chart.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2004 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 #include <stdio.h>
18 #include <stdarg.h>
19 #include <string.h>
20 #include <stdio.h>
21 #include <float.h>
22 #include <assert.h>
23 #include <math.h>
24
25
26 #include <math/chart-geometry.h>
27 #include <output/chart.h>
28
29 #include <libpspp/str.h>
30 #include <output/manager.h>
31 #include <output/output.h>
32
33 #include "xalloc.h"
34
35 #ifndef PLOT_CHART_H
36 #define PLOT_CHART_H
37
38
39 extern const char *const data_colour[];
40
41 enum tick_orientation {
42   TICK_ABSCISSA=0,
43   TICK_ORDINATE
44 };
45
46
47 /* Draw a tick mark at position
48    If label is non zero, then print it at the tick mark
49 */
50 void draw_tick(struct chart *chart,
51           enum tick_orientation orientation,
52           double position,
53                const char *label, ...);
54
55
56 /* Write the title on a chart*/
57 void   chart_write_title(struct chart *chart, const char *title, ...);
58
59
60 /* Set the scale for the abscissa */
61 void  chart_write_xscale(struct chart *ch, double min, double max, int ticks);
62
63
64 /* Set the scale for the ordinate */
65 void  chart_write_yscale(struct chart *ch, double smin, double smax, int ticks);
66
67 void chart_write_xlabel(struct chart *ch, const char *label) ;
68
69 /* Write the ordinate label */
70 void  chart_write_ylabel(struct chart *ch, const char *label);
71
72 #endif