libtpcsvg
 All Data Structures Files Functions Variables Enumerations Enumerator Defines
Functions | Variables
axis.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "axis.h"
Include dependency graph for axis.c:

Go to the source code of this file.

Functions

int axis_tick_positions (double begin, double end, double *ticks, int *tick_nr, double *scale_factor, int *tick_decimals)
void axis_check_range (double *begin, double *end)

Variables

int AXIS_TEST = 0

Function Documentation

void axis_check_range ( double *  begin,
double *  end 
)

Check and if necessary correct axis range: min must be smaller than max. Also, if the range is close to zero, then make it larger. Also, if the range is relatively large, then change it to start from zero.

Parameters:
beginaxis range minimum
endaxis range maximum

Definition at line 155 of file axis.c.

Referenced by svg_calculate_axes().

int axis_tick_positions ( double  begin,
double  end,
double *  ticks,
int *  tick_nr,
double *  scale_factor,
int *  tick_decimals 
)

Define suitable tick positions for XY plot

Returns:
Returns 0 if successful, <>0 in case of error.
Parameters:
beginaxis range minimum
endaxis range maximum
ticksPointer to array where tick values will be written
tick_nrInput: Max allowed nr of ticks; Output: actual nr of ticks
scale_factorOutput: Suggested scale factor (x10^sf). NULL, if not needed
tick_decimalsOutput: tick value precision (nr of decimals). NULL, if not needed.

Definition at line 58 of file axis.c.

References AXIS_TEST.

Referenced by main(), and svg_calculate_axes().


Variable Documentation

int AXIS_TEST = 0

Definition at line 53 of file axis.c.

Referenced by axis_tick_positions(), and main().