-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_axis.h
52 lines (39 loc) · 993 Bytes
/
plot_axis.h
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
#ifndef __PLOT_AXIS__
#define __PLOT_AXIS__
#include <cairo.h>
#include "plot_color.h"
#include "plot_area.h"
typedef struct {
// Number of tick marks
int number;
// Tick line direction
int dir;
// Tick line thickness
double thick;
// Tick line length
double len;
// Tick color
t_color color;
} t_ticks;
enum axis_type {LINEAR, LOG, SYMLOG};
typedef struct {
// Axis type
enum axis_type type;
// Axis range
double min, max;
// Threshold for sym. axis
double sym;
// Direction
int direction;
// Axis color
t_color color;
// Axis thickness
double thick;
// Major / minor tickmarks properties
t_ticks major, minor;
} t_plot_axis;
void draw_axis( t_plot_axis* axis, t_plot_area *area, cairo_t *cr );
void init_axis( t_plot_axis* axis, int dir );
double scale_axis( t_plot_axis* axis, double val );
void scale_arr_axis( t_plot_axis* axis, double *val, int size, double *out );
#endif