|  |  |  | Goffice Reference Manual |  | 
|---|---|---|---|---|
#include <gog-axis.h>
            GogAxisMap;
GogAxisMap* gog_axis_map_new                (GogAxis *axis,
                                             double offset,
                                             double length);
double      gog_axis_map                    (GogAxisMap *map,
                                             double value);
double      gog_axis_map_to_view            (GogAxisMap *map,
                                             double value);
double      gog_axis_map_from_view          (GogAxisMap *map,
                                             double value);
gboolean    gog_axis_map_finite             (GogAxisMap *map,
                                             double value);
double      gog_axis_map_get_baseline       (GogAxisMap *map);
void        gog_axis_map_get_extents        (GogAxisMap *map,
                                             double *start,
                                             double *stop);
void        gog_axis_map_get_bounds         (GogAxisMap *map,
                                             double *minimum,
                                             double *maximum);
void        gog_axis_map_free               (GogAxisMap *map);
gboolean    gog_axis_map_is_valid           (GogAxisMap *map);
GogAxisMap* gog_axis_map_new (GogAxis *axis, double offset, double length);
Creates a GogAxisMap for data mapping to plot window. offset and length are optional parameters to be used with gog_axis_map_to_view in order to translates data coordinates into canvas space.
| axis: | a GogAxis | 
| offset: | start of plot area. | 
| length: | length of plot area. | 
| Returns : | a newly allocated GogAxisMap. | 
double gog_axis_map (GogAxisMap *map, double value);
Converts value to plot coordinates. A value in [0,1.0] range means a data 
within axis bounds.
| map: | a GogAxisMap value : value to map to plot space. | 
| value: | |
| Returns : | mapped value. | 
double gog_axis_map_to_view (GogAxisMap *map, double value);
Converts value from data space to canvas space, using offset and length parameters given to gog_axis_map_new.
| map: | a GogAxisMap | 
| value: | value to map to canvas space | 
| Returns : | a value in canvas coordinates | 
double gog_axis_map_from_view (GogAxisMap *map, double value);
Converts value from canvas space to data space.
| map: | a GogAxisMap | 
| value: | value to unmap from canvas space. | 
| Returns : | value in data coordinates | 
gboolean gog_axis_map_finite (GogAxisMap *map, double value);
Tests wether value is valid for the given map.
| map: | a GogAxisMap | 
| value: | value to test | 
| Returns : | TRUEif value means something | 
double gog_axis_map_get_baseline (GogAxisMap *map);
Gets the baseline for map, in view coordinates,
clipped to offset and offset+length, where offset and length
are the parameters of gog_axis_map_new.
| map: | a GogAxisMap | 
| Returns : | 
void gog_axis_map_get_extents (GogAxisMap *map, double *start, double *stop);
Gets start and stop for the given axis map in data coordinates. If axis is not inverted, start = minimum and stop = maximum. If axis is invalid, it'll return arbitrary bounds. For example, an non inverted invalid X axis will have start set to 0.0 and stop set to 1.0.
minimum or maximum can be NULL.
| map: | a GogAxisMap | 
| start: | start for this axis | 
| stop: | stop for this axis | 
void gog_axis_map_get_bounds (GogAxisMap *map, double *minimum, double *maximum);
Gets bounds for the given axis map in data coordinates. If axis is invalid, it'll return arbitrary bounds. For example, for an invalid x axis, minimum = 0.0 and maximum = 1.0.
minimum or maximum can be NULL.
| map: | a GogAxisMap | 
| minimum: | minimum for this axis | 
| maximum: | maximum for this axis | 
void gog_axis_map_free (GogAxisMap *map);
Frees GogAxisMap object.
| map: | a GogAxisMap | 
gboolean gog_axis_map_is_valid (GogAxisMap *map);
Tests if map was correctly initialized, i.e. if bounds are
valid.
| map: | a GogAxisMap | 
| Returns : | TRUEif map is valid |