giza - API Reference Manual

- news
- download
- documentation
- contact
- samples

# API Reference Manual

Here we provided a function by function reference for the low-level C API to giza.
The giza API is stable. From version 1.0 we aim to keep backwards compatibility, although new functionality may be added

# Index

Device Management
  giza_device_has_cursor
  giza_open_device
  giza_open_device_size
  giza_open_device_size_float
  giza_get_device_id
  giza_select_device
  giza_flush_device
  giza_change_page
  giza_close_devices
  giza_close_device
  _giza_close_device_unchecked
  _giza_init_device_struct
  giza_query_device
  giza_get_surface_size
  giza_get_surface_size_float
  giza_histogram
  giza_histogram_float
  giza_histogram_binned
  giza_histogram_binned_float
  giza_subpanel
  giza_set_panel
  giza_get_panel
  giza_init_subpanel
  giza_advance_panel
Drawing
  giza_arrow
  giza_arrow_float
  giza_box_time
  giza_box_time_float
  giza_box
  giza_box_float
  giza_circle
  giza_circle_float
  giza_clip
  giza_get_clipping
  giza_colour_bar
  giza_colour_bar_float
  giza_draw_background
  giza_draw
  giza_draw_float
  giza_error_bars
  giza_error_bars_float
  giza_error_bars_vert
  giza_error_bars_vert_float
  giza_function_t
  giza_function_t_float
  giza_function_x
  giza_function_x_float
  giza_line
  giza_line_float
  giza_move
  giza_move_float
  giza_get_current_point
  giza_get_current_point_float
  giza_points
  giza_points_float
  giza_single_point
  giza_single_point_float
  giza_polygon
  giza_polygon_float
  giza_rectangle
  giza_rectangle_float
  giza_rectangle_rounded
  giza_rectangle_rounded_float
  giza_render
  giza_render_transparent
  giza_render_alpha
  giza_render_float
  giza_render_transparent_float
  giza_render_alpha_float
  giza_render_gray
  giza_render_gray_float
  giza_draw_pixels
  giza_draw_pixels_float
  giza_vector
  giza_vector_float
Text
  giza_annotate
  giza_annotate_float
  giza_label
  giza_print_id
  giza_ptext
  giza_ptext_float
  giza_text
  giza_text_float
  giza_qtext
  giza_qtext_float
  giza_qtextlen
  giza_qtextlen_float
Settings
  giza_set_arrow_style
  giza_set_arrow_style_float
  giza_get_arrow_style
  giza_get_arrow_style_float
  giza_set_band_style
  giza_get_band_style
  giza_begin_buffer
  giza_end_buffer
  giza_get_buffering
  giza_flush_buffer
  giza_set_character_height
  giza_set_character_height_float
  giza_get_character_height
  giza_get_character_height_float
  giza_get_character_size
  giza_get_character_size_float
  giza_set_colour_index
  giza_get_colour_index
  giza_set_colour_representation
  giza_set_colour_representation_float
  giza_set_colour_representation_alpha
  giza_set_colour_representation_alpha_float
  giza_set_colour_representation_hls
  giza_set_colour_representation_hls_float
  giza_set_colour_representation_rgb
  giza_set_colour_representation_rgba
  giza_set_colour_representation_rgba_float
  giza_get_colour_representation
  giza_get_colour_representation_alpha
  giza_set_colour_index_range
  giza_get_colour_index_range
  giza_set_range_as_colour_table
  giza_set_colour_palette
  giza_set_colour_table
  giza_set_colour_table_float
  giza_rgb_from_table
  giza_rgb_from_table_float
  giza_save_colour_table
  giza_restore_colour_table
  giza_set_environment
  giza_set_environment_float
  giza_set_fill
  giza_get_fill
  giza_set_hatching_style
  giza_set_hatching_style_float
  giza_get_hatching_style
  giza_get_hatching_style_float
  giza_begin_autolog
  giza_end_autolog
  giza_set_line_cap
  giza_get_line_cap
  giza_set_line_style
  giza_get_line_style
  giza_set_line_width
  giza_set_line_width_float
  giza_get_line_width
  giza_start_prompting
  giza_stop_prompting
  giza_save
  giza_restore
  giza_set_font
  giza_set_font_bold
  giza_set_font_italic
  giza_set_font_bold_italic
  giza_get_font
  giza_set_text_background
  giza_get_text_background
  giza_version
  giza_set_viewport
  giza_set_viewport_float
  giza_get_viewport
  giza_get_viewport_float
  giza_set_viewport_default
  giza_set_viewport_inches
  giza_set_viewport_inches_float
  giza_start_warnings
  giza_stop_warnings
  giza_set_window
  giza_set_window_float
  giza_set_window_equal_scale
  giza_set_window_equal_scale_float
  giza_get_window
  giza_get_window_float
Interactive
  giza_band
  giza_band_float
  giza_mark_points
  giza_mark_points_float
  giza_mark_points_ordered
  giza_mark_points_ordered_float
  giza_mark_line
  giza_mark_points_float
  giza_mark_line_ordered
  giza_mark_line_ordered_float
  giza_mark_line_char
  giza_mark_points_float
  giza_get_key_press

# Device Managment

### giza_device_has_cursor

int | giza_device_has_cursor | (void) ;

Query the interactivity of the device.

#### Return:

0 : | If the device is not interactive.
1 : | If the device is interactive.

### giza_open_device

int | giza_open_device | (const char *newDeviceName, const char *newPrefix) ;

Opens a new device to be drawn to. Must be called before any drawing can take place.

#### Input:

newDeviceName : | Specifies the name and type of device to be opened. See below for details.
newPrefix : | Specifies the default prefix to be used for file names.

#### Return value:

<=0 : | an error has occurred
1 : | id of current device Note: this is the EXTERNAL device number, running from 1..Ndev The internal device numbers are array indices into the Dev[...] array and run from 0..Ndev-1

#### Available devices:

? : | User selects device
/xw : | X-window
/eps : | Encapsulated Postscript
/png : | Portable Network Graphics file
/svg : | Scalable Vector Graphics file
/pdf : | Portable Document Format
/vpdf : | Landscape Portable Document Format
/ps : | PostScript
/vps : | Landscape Postscript

#### e.g:

#### See Also:

giza_select_device giza_get_device_id giza_close_device giza_query_device

### giza_open_device_size

int | giza_open_device_size | (const char *newDeviceName, const char *newPrefix, double width, double height, int units) ;

Similar to giza_open_device, but allows one to specify the size of the device

#### Input:

newDeviceName : | Specifies the type of device to be opened. See below for details.
newPrefix : | Specifies the default prefix to be used for file names.
width : | Width for the newly opened device
height : | Height for the newly opened device
units : | Units in which the width/height of the device are specified

#### Units:

GIZA_UNITS_DEVICE : | device coords (i.e. pixels on bitmap devices, points on vector devices)
GIZA_UNITS_PIXELS : | pixels
GIZA_UNITS_MM : | mm
GIZA_UNITS_INCHES : | inches Other values cause an error message and are treated as GIZA_UNITS_DEVICE

#### See also:

### giza_open_device_size_float

int | giza_open_device_size_float | (const char *newDeviceName, const char *newPrefix, float width, float height, int units) ;

Same functionality as giza_open_device_size but takes floats

### giza_get_device_id

void | giza_get_device_id | (int *devid) ;

Returns the (external) id of the currently selected device

#### Output:

#### See also:

### giza_select_device

void | giza_select_device | (int devid) ;

Select between the currently open devices

#### Input:

devid : | device id, as returned by giza_open_device

#### See also:

### giza_flush_device

void | giza_flush_device | (void) ;

Flushes the currently open device.

### giza_change_page

void | giza_change_page | (void) ;

Advances the currently open device to the next page, and redraws the background. If no other actions have been performed since the device was opened or the last call to giza_change_page the call is ignored.

#### See also:

### giza_close_devices

void | giza_close_devices | (void) ;

Close all open devices (to be called from PGEND())

### giza_close_device

void | giza_close_device | (void) ;

Closes the currently open device. Should always be called before exiting your program as it frees associated memory.

### _giza_close_device_unchecked

void |  | ;

In order to be able to share the cleaning-up code between giza_close_device() and giza_open_device_size() [when something fails during the construction of a new device] the actual cleaning up code is put in this internal function.

#### state:

### _giza_init_device_struct

void |  | ;

resets the contents of a giza_device_t to a known state: the whole struct is zeroed out and .type is set to GIZA_DEVICE_IV.

#### Note:

#### giza_device_t using a compond struct initializer like this:

#### See https:

#### Input:

ptrDev : | a pointer to a giza_device_t

### giza_query_device

int | giza_query_device | (const char *querytype, char *returnval, int* rlen) ;

Queries various things about the current device.

#### Input:

querytype : | a string containing the query type
rlen : | integer containing the length of the return buffer

#### Output:

returnval : | string with result of query

#### The following query types are possible:

#### "state" :

#### "device" :

#### "type" :

#### "dev/type" :

#### "file" :

#### "user" :

#### "cursor" :

#### "hardcopy" :

### giza_get_surface_size

void | giza_get_surface_size | (double *x1, double *x2, double *y1, double *y2) ;

Gets the size of the current surface that can be drawn to in device units (pixels or points).

#### Input:

x1 : | Always gets set to 0.0
x2 : | Gets set to the width of the current surface
y1 : | Always gets set to 0.0
y2 : | Gets set to the width of the surface

### giza_get_surface_size_float

void | giza_get_surface_size_float | (float *x1, float *x2, float *y1, float *y2) ;

Same functionality as giza_get_surface_size, but uses floats.

#### See Also:

giza_get_surface_size

### giza_histogram

void | giza_histogram | (int n, const double *dat, double min, double max, int nbin, int flag) ;

Plot a histogram (unbinned)

#### Input:

n : | number of data values
dat : | data (n values)
min : | minimum data value to use in histogram
max : | maximum data value to use in histogram
nbin : | number of bins
flag : | flag to indicate page changes, see below

#### See also:

#### Flag:

0 : | giza_histogram calls giza_environment to set up new plotting page
1 : | plot in current window and viewport
2 : | with filled area style, calls giza_environment
3 : | with filled area style, in current window and viewport
4 : | bins drawn as simple outlines, as in giza_histogram_binned, calls giza_environment
5 : | bins drawn as simple outlines, but in current window and viewport Other values treated as 1

### giza_histogram_float

void | giza_histogram_float | (int n, const float *dat, float min, float max, int nbin, int flag) ;

Same as giza_histogram but takes floats

#### See also:

### giza_histogram_binned

void | giza_histogram_binned | (int n, const double *x, const double *dat, int centre) ;

Plot a histogram of already binned data

#### Input:

n : | number of bins
x : | x values of bins
dat : | data values for each bin
center : | if true (1) x values correspond to centre of each bin

#### See also:

### giza_histogram_binned_float

void | giza_histogram_binned_float | (int n, const float *x, const float *dat, int centre) ;

Same as giza_histogram_binned but takes floats

#### See also:

### giza_subpanel

void | giza_subpanel | (int nx, int ny) ;

Set the number of sub panels

#### Input:

nx : | number of sub-panels in x direction
ny : | number of sub panels in y direction

#### See also:

### giza_set_panel

void | giza_set_panel | (int ix, int iy) ;

Select the panel we are currently plotting in

#### Input:

ix : | panel index in x direction
iy : | panel index in y direction

#### See also:

### giza_get_panel

void | giza_get_panel | (int *ix, int *iy) ;

Select the panel we are currently plotting in

#### Input:

ix : | panel index in x direction
iy : | panel index in y direction

#### See also:

### giza_init_subpanel

void | _giza_init_subpanel | () ;

initialises subpanel settings for device

### giza_advance_panel

void | _giza_advance_panel | (int *newpage) ;

Moves to next panel

# Drawing

### giza_arrow

void | giza_arrow | (double x1, double y1, double x2, double y2) ;

Draws an arrow. The style of the head of the arrow is set by giza_set_arrow_style.

#### Input:

x1 : | The world x-coord of the tail of the arrow.
y1 : | The world y-coord of the tail of the arrow.
x2 : | The world x-coord of the head of the arrow.
y2 : | The world y-coord of the head of the arrow.

#### See Also:

giza_set_arrow_style

### giza_arrow_float

void | giza_arrow_float | (float x1, float y1, float x2, float y2) ;

Same functionality as giza_arrow.

#### See Also:

giza_arrow_float

### giza_box_time

void |  | giza_box_time (const char *xopt, double xtick, int nxsub, const char *yopt, double ytick, int nysub) ;

Same as giza_box, but labels axes with time-style labels i.e. DD HH MM SS as used in RA - DEC plots for Astronomy. If this option is used then giza_set_window should have been called with min/max given in seconds of time.

#### Input:

xopt : | As for giza_box, plus additional options below
xtick : | The distance, in world coordinates, between major ticks on the x-axis. If 0.0 the interval is chosen by giza_box_time.
nxsub : | The number of minor ticks to be placed between each major tick. If 0 the number is chosen by giza_box.
yopt : | Similar to xdraw_minticks but for the y-axis.
ytick : | Similar to xtick but for the y-axis.
nysub : | Similar to nxsub but for the y-axis.

#### Options for xopt and yopt (same as for giza_box, plus those below):

Z : | for time-style labelling: (DD) HH MM SS.S
Y : | exclude the day field so labels are just HH MM SS.S (hours can be >24)
X : | keep HH field in range (0..24)
H : | use d,h,m,s superscripts to label numbers
D : | use degree o, minute ' and second '' superscripts to label numbers
F : | do not draw the first label (left- or bottom-most)
O : | omit leading zeros in numbers < 10, i.e. 3 instead of 03

#### See Also:

giza_box giza_box_float giza_box_time_float

### giza_box_time_float

void | giza_box_time_float | (const char *xopt, float xtick, int nxsub, const char *yopt, float ytick, int nysub) ;

Same functionality as giza_box_time but takes floats instead of doubles.

#### See Also:

giza_box_time giza_box

### giza_box

void | giza_box | (const char *xopt, double xtick, int nxsub, const char *yopt, double ytick, int nysub) ;

Annotates the viewport with labelled axis/frame

#### Input:

xopt : | String of options for the x-axis. The options may be in any order. See below for details
xtick : | The distance, in world coordinates, between major ticks on the x-axis. If 0.0 the interval is chosen by giza_box.
nxsub : | The number of minor ticks to be placed between each major tick. If 0 the number is chosen by giza_box.
yopt : | Similar to xopt but for the y-axis.
ytick : | Similar to xtick but for the y-axis.
nysub : | Similar to nxsub but for the y-axis.

#### Options:

A : | Draw the axis.
B : | Draw the bottom or left edge of the frame.
C : | Draw the top or right edge of the frame.
T : | Draw major ticks.
S : | Draw minor ticks.
N : | Label the axis (conventional, below/left viewport)
M : | Put labels in the unconvential location (above/right viewport)
V : | Orient numeric y labels vertically (only applies to left and right axis).
G : | Draw grid lines at major intervals
M : | Write numeric labels above x-axis or to right of y-axis instead of usual position
L : | Label axis logarithmically
I : | 'Invert' tick marks, draw them outside the viewport
P : | extend ("Project") major tick marks outside the box (ignored if option I is specified).

### giza_box_float

void | giza_box_float | (const char *xopt, float xtick, int nxsub, const char *yopt, float ytick, int nysub) ;

Same functionality as giza_box but takes floats instead of doubles.

#### See Also:

giza_box

### giza_circle

void | giza_circle | (double x, double y, double r) ;

Draws a circle at x, y with radius r (in world coords), using the current fill set by giza_set_fill.

#### Input:

x : | the world x-coord of the centre of the circle
y : | the world y-coord of the centre of the circle
r : | the radius of the circle in world coords

### giza_circle_float

void | giza_circle_float | (float x, float y, float r) ;

Same functionality as giza_circle, but takes floats

#### See Also:

giza_circle

### giza_clip

void | giza_set_clipping | (int clip) ;

Set whether or not to clip at the edge of the viewport

#### Input:

clip : | Use 0 to disable clipping, 1 to enable clipping

### giza_get_clipping

void | giza_get_clipping | (int *clip) ;

Query whether or not clipping at edge of viewport is enabled or disabled

#### See Also:

giza_move

### giza_colour_bar

void | giza_colour_bar | (const char *side, double disp, double width, double valMin, double valMax, const char *label) ;

Draws a colour bar (wedge) using the current colour ramp

#### Input:

side : | edge of viewport to draw colour bar relative to, either 'B' (bottom), 'T' (top), 'L' (left) or 'R' (right)
disp : | displacement of the bar in character heights from the specified edge
width : | width of the colour bar in character heights
valMin : | The value in data that gets assigned the colour corresponding to zero on the colour ramp (The ramp is set by giza_set_colour_table)
valMax : | The value in data that gets assigned the colour corresponding to one on the colour ramp
label : | Text label to annotate colour bar with

#### See Also:

giza_render giza_colour_bar_float giza_set_colour_table

### giza_colour_bar_float

void | giza_colour_bar_float | (const char *side, float disp, float width, float valMin, float valMax, const char *label) ;

Same functionality as giza_colour_bar, but takes floats

#### See Also:

giza_colour_bar

### giza_draw_background

void | giza_draw_background | (void) ;

Redraws the background of the currently open device (erase)

### giza_draw

void | giza_draw | (double xpt, double ypt) ;

Plots a line from current pen position to a point

#### Input:

xpt : | The world x-coordinates of the point
ypt : | The world y-coordinates of the point

### giza_draw_float

void | giza_draw_float | (float xpt, float ypt) ;

The same functionality as giza_draw, except it uses floats

### giza_error_bars

void | giza_error_bars | (int dir, int n, const double *xpts, const double *ypts, const double *error, double term) ;

Draws error bars.

#### Input:

dir : | the direction of the error bar, see below
n : | the number of points
xpts : | the x world coords of the points
ypts : | the y world coords of the points
error: | the length of the bar to be drawn in world coords
term : | the length of the terminals as a multiple of the default length

#### Directions:

1 : | +x
2 : | +y
3 : | -x
4 : | -y
5 : | +x and -x
6 : | +y and -y
7 : | -y but instead of drawing bars use a semi-transparent shaded region
8 : | +y using a semi-transparent shaded region
9 : | +y and -y using a semi-transparent shaded region

### giza_error_bars_float

void | giza_error_bars_float | (int dir, int n, const float *xpts, const float *ypts, const float *error, float term) ;

Same as giza_error_bars but takes floats.

### giza_error_bars_vert

void | giza_error_bars_vert | (int n, const double *xpts, const double *ypts1, const double *ypts2, double term) ;

Draws n vertical error bars. A call to giza_points must be made to draw the actual points.

#### Input:

n : | the number of bars to draw
xpts : | the x world coords of the points
ypts1 : | the y world coords of the lower part of the error bar
ypts2 : | the y world coords of the upper part of the error bar
term : | length of the terminals, as a multiple of default length (T <= 0.0 means no terminals drawn)

### giza_error_bars_vert_float

void | giza_error_bars_vert_float | (int n, const float *xpts, const float *ypts1, const float *ypts2, float term) ;

Same functionality as giza_error_bars_vert but takes floats.

### giza_function_t

void | giza_function_t | (double (*funcx)(double *t), double (*funcy)(double *t), int n, double tmin, double tmax, int flag) ;

Draw a curve defined by x = func(t), y = func(t), where funcx(t) and funcy(t) are user-supplied routines with a single double argument passed by reference, e.g. double myfuncx(double* t) double myfuncy(double* t)

#### Input:

funcx : | The parametrisation of the x value.
funcy : | The parametrisation of the y value.
n : | The number of segments to use to approximate the curve.
tmin : | The lower bound on the domain of t.
tmax : | The upper bound on the domain of t.

### giza_function_t_float

void | giza_function_t_float | (float (*funcx)(float *t), float (*funcy)(float *t), int n, float tmin, float tmax, int flag) ;

The same functionality as giza_function_t but uses floats. Draw a curve defined by x = func(y), where func(y) is a user-supplied routine with a single float argument passed by reference, e.g. float myfuncx(float* t) float myfuncy(float* t)

#### See Also:

giza_function_t

### giza_function_x

void | giza_function_x | (double (*func)(double *x), int n, double xmin, double xmax, int flag) ;

Draw a curve defined by y = func(x), where func(x) is a user-supplied routine with a single double argument, e.g. double myfunc(double* x)

#### Input:

func : | The function describing y's dependence on x.
n : | The number of segments with whichh to approximate the curve
xmin : | The lower bound on the domain of x.
xmax : | The upper bound on the domain of x.

### giza_function_x_float

void | giza_function_x_float | (float (*func)(float *x), int n, float xmin, float xmax, int flag) ;

Same functionality as giza_function_x but takes floats. Draw a curve defined by y = func(x), where func(x) is a user-supplied routine with a single double argument, e.g. float myfunc(float* x)

#### See Also:

giza_function_x

### giza_line

void | giza_line | (int n, const double *xpts, const double *ypts) ;

Plots a line made up of n-1 straight segments.

#### Input:

n : | The number of points that define the line. The line will be made up of n - 1 straight segments. If n is less than 2 nothing is done.
xpts : | The world x-coordinates of the points to be joined.
ypts : | The world y-coordinates of the points to be joined.

### giza_line_float

void | giza_line_float | (int n, const float *xpts, const float *ypts) ;

The same functionality as giza_line, except it uses arrays of floats

#### See Also:

giza_line

### giza_move

void | giza_move | (double xpt, double ypt) ;

Move current pen position to a point

#### Input:

xpt : | The world x-coordinates of the point
ypt : | The world y-coordinates of the point

### giza_move_float

void | giza_move_float | (float xpt, float ypt) ;

The same functionality as giza_move, except it uses floats

#### See Also:

giza_move

### giza_get_current_point

void | giza_get_current_point | (double *xpt, double *ypt) ;

Query current pen position

#### Output:

xpt : | The world x-coordinates of the point
ypt : | The world y-coordinates of the point

#### See Also:

giza_get_current_point_float

### giza_get_current_point_float

void | giza_get_current_point_float | (float *xpt, float *ypt) ;

The same functionality as giza_get_current_point, but uses floats

#### See Also:

giza_get_current_point

### giza_points

void | giza_points | (int n, const double* x, const double* y, int symbol) ;

Plot n points at x[n], y[n] in world coords.

#### Input:

n : | the number of points
x : | the x-coordinates of the points in world coords
y : | the y-coordinates of the points in world coords
symbol : | the type of marker to use

#### Symbols:

default : | small point (same as 1)
0 : | square
1 : | .
2 : | +
3 : | *
4 : | o
5 : | x
>31 : | from the Unicode table

### giza_points_float

void | giza_points_float | (int n, const float* x, const float* y, int symbol) ;

Same functionality as giza_points but takes floats.

#### See Also:

giza_points

### giza_single_point

void | giza_single_point | (double x, double y, int symbol) ;

Plots a single point at x, y in world coords.

#### Input:

x : | the x-coordinate of the point in world coords
y : | the y-coordinate of the point in world coords
symbol : | the type of marker to use

### giza_single_point_float

void | giza_single_point_float | (float x, float y, int symbol) ;

Same functionality as giza_single_point, but uses floats.

#### See Also:

giza_single_point

### giza_polygon

void | giza_polygon | (int n, const double *xpts, const double *ypts) ;

Draws a polygon, using the current fill set by giza_set_fill.

#### Input:

n : | number of vertices
xpts : | x positions of vertices
ypts : | y positions of vertices

#### See Also:

giza_set_fill

### giza_polygon_float

void | giza_polygon_float | (int n, const float *xpts, const float *ypts) ;

Same functionality as giza_polygon, but takes floats

#### See Also:

giza_polygon

### giza_rectangle

void | giza_rectangle | (double x1, double x2, double y1, double y2) ;

Draws a rectangle with corners ((x1, y1) (x2, y1) (x2, y2) (x1, y2)), using the current fill set by giza_set_fill.

#### Inputs:

x1 : | the x-coordinate of two of the points
x2 : | the x-coordinate of the other two points
y1 : | the y-coordinate of two of the points
y2 : | the y-coordinate of the other two points

#### See Also:

giza_set_fill giza_polygon

### giza_rectangle_float

void | giza_rectangle_float | (float x1, float x2, float y1, float y2) ;

Same functionality as giza_rectangle but takes floats

#### See Also:

giza_rectangle

### giza_rectangle_rounded

void | giza_rectangle_rounded | (double x1, double x2, double y1, double y2, double radius) ;

Draws a rectangle with rounded corners ((x1, y1) (x2, y1) (x2, y2) (x1, y2)), using the current fill set by giza_set_fill.

#### Inputs:

x1 : | the x-coordinate of two of the points
x2 : | the x-coordinate of the other two points
y1 : | the y-coordinate of two of the points
y2 : | the y-coordinate of the other two points
radius : | radius of curvature for the corners

#### See Also:

giza_rectangle giza_set_fill giza_polygon

### giza_rectangle_rounded_float

void | giza_rectangle_rounded_float | (float x1, float x2, float y1, float y2, float radius) ;

Same functionality as giza_rectangle_rounded but takes floats

#### See Also:

giza_rectangle_rounded

### giza_render

void | giza_render | (int sizex, int sizey, const double* data, int i1, int i2, int j1, int j2, double valMin, double valMax, int extend, const double *affine) ;

Renders data to the device.

#### Input:

sizex : | The dimensions of data in the x-direction
sizey : | The dimensions of data in the y-direction
data : | The data to be render
i1 : | The inclusive range of data to render in the x dimension.
i2 : | The inclusive range of data to render in the x dimension.
j1 : | The inclusive range of data to render in the y direction
j2 : | The inclusive range of data to render in the y direction
valMin : | The value in data that gets assign the colour corresponding to zero on the colour ramp (The ramp is set by giza_set_colour_table)
valMax : | The value in data that gets assigned the colour corresponding to one on the colour ramp
extend : | Option for how to deal with image at edges
affine : | The affine transformation matrix that will be applied to the data.

#### Allowed extend settings:

0 or GIZA_EXTEND_NONE : | no padding
1 or GIZA_EXTEND_REPEAT : | periodic tiling
2 or GIZA_EXTEND_REFLECT : | reflective boundary
3 or GIZA_EXTEND_PAD : | pad by extending last few pixels

#### See Also:

giza_set_colour_table

### giza_render_transparent

void | giza_render_transparent | (int sizex, int sizey, const double* data, int i1, int i2, int j1, int j2, double valMin, double valMax, int extend, const double *affine) ;

Same as giza_render, but data < valMin rendered as transparent

### giza_render_alpha

void | giza_render_alpha | (int sizex, int sizey, const double* data, const double* alpha, int i1, int i2, int j1, int j2, double valMin, double valMax, int extend, const double *affine) ;

Same as giza_render, but uses additional array specifying transparency of each pixel

### giza_render_float

void | giza_render_float | (int sizex, int sizey, const float* data, int i1, int i2, int j1, int j2, float valMin, float valMax, int extend, const float *affine) ;

Same functionality as giza_render but takes floats.

#### See Also:

giza_render

### giza_render_transparent_float

void | giza_render_transparent_float | (int sizex, int sizey, const float* data, int i1, int i2, int j1, int j2, float valMin, float valMax, int extend, const float *affine) ;

Same functionality as giza_render_transparent but takes floats.

#### See Also:

giza_render_transparent

### giza_render_alpha_float

void | giza_render_alpha_float | (int sizex, int sizey, const float* data, const float* alpha, int i1, int i2, int j1, int j2, float valMin, float valMax, int extend, const float *affine) ;

Same as giza_render_alpha but takes floats

#### See Also:

giza_render_alpha

### giza_render_gray

void | giza_render_gray | (int sizex, int sizey, const double* data, int i1, int i2, int j1, int j2, double valMin, double valMax, int extend, const double *affine) ;

Same functionality as giza_render but renders in grayscale

#### See Also:

giza_render

### giza_render_gray_float

void | giza_render_gray_float | (int sizex, int sizey, const float* data, int i1, int i2, int j1, int j2, float valMin, float valMax, int extend, const float *affine) ;

Same functionality as giza_render_gray but renders in grayscale

#### See Also:

giza_render_gray giza_render

### giza_draw_pixels

void | giza_draw_pixels | (int sizex, int sizey, const int* idata, int i1, int i2, int j1, int j2, double xmin, double xmax, double ymin, double ymax, int extend) ;

Renders an array of pixels according to a colour index defined for each pixel

#### Input:

sizex : | The dimensions of data in the x-direction
sizey : | The dimensions of data in the y-direction
idata : | The data to be rendered (colour index on each pixel)
i1 : | The inclusive range of data to render in the x dimension.
i2 : | The inclusive range of data to render in the x dimension.
j1 : | The inclusive range of data to render in the y direction
j2 : | The inclusive range of data to render in the y direction
xmin : | world coordinate corresponding to left of pixel array
xmax : | world coordinate corresponding to right of pixel array
ymin : | world coordinate corresponding to bottom of pixel array
ymax : | world coordinate corresponding to top of pixel array
extend : | Option for how to deal with image at edges (see giza_render)

#### See Also:

giza_render giza_draw_pixels_float

### giza_draw_pixels_float

void | giza_draw_pixels_float | (int sizex, int sizey, const int* idata, int i1, int i2, int j1, int j2, float xmin, float xmax, float ymin, float ymax, int extend) ;

Same as giza_draw_pixels, but takes floats

#### See Also:

giza_draw_pixels

### giza_vector

void | giza_vector | (int n, int m, const double* horizontal, const double* vertical, int i1, int i2, int j1, int j2, double scale, int position, const double* affine, double blank) ;

Plot of vector data.

#### Input:

n : | The dimensions of data in the x-direction
m : | The dimensions of data in the y-direction
horizontal : | The x-component of the data to be plotted
vertical : | The y-component of the data to be plotted
i1 : | The inclusive range of data to render in the x dimension.
i2 : | The inclusive range of data to render in the x dimension.
j1 : | The inclusive range of data to render in the y direction
j2 : | The inclusive range of data to render in the y direction
scale : | scaling factor for arrow lengths (0 = automatic)
position : | justification of vector arrow with respect to pixel (0=left, 0.5=centred)
affine : | The affine transformation matrix that will be applied to the data.

#### See Also:

giza_vector_float giza_arrow giza_set_arrow_style

### giza_vector_float

void | giza_vector_float | (int n, int m, const float* horizontal, const float* vertical, int i1, int i2, int j1, int j2, float scale, int position, const float* affine, float blank) ;

Same as giza_vector but takes floats

#### See Also:

giza_vector giza_arrow giza_set_arrow_style

# Text

### giza_annotate

void | giza_annotate | (const char *side, double displacment, double coord, double justification, const char *string) ;

Writes text with a position relative to the viewport.

#### Input:

side : | Must contain a character 'B','L','T' or 'R' specifying the bottom, left, top or right margin respectively. The position of the text will be relative to the specified side.
displacement : | The displacement of the text from the edge of the view-port specified in side, measured out of the view-port in units of character height.
coord : | The location of the text along the edge of the view port specified in side, measured as a fraction of that size
justification : | Specifies the justification of the text. 0.0 means the left most edge of the string will be aligned with coord, 1.0 means the right most edge of the string will be aligned with coord etc.
string : | The text that will be displayed.

### giza_annotate_float

void | giza_annotate_float | (const char *side, float displacment, float coord, float justification, const char *string) ;

The same functionality as giza_annotate but takes floats instead of doubles.

#### See Also:

giza_annotate

### giza_label

void | giza_label | (const char *labelx, const char *labely, const char *title) ;

Labels the plot

#### Input:

labelx : | x-axis label
labely : | y-axis label
title : | The title of the plot

### giza_print_id

void | giza_print_id | (void) ;

Prints user ID, date and time on the plot

### giza_ptext

void | giza_ptext | (double x, double y, double angle, double just, const char *text) ;

Draws text at a given position in world coords at a given angle with a given justification.

#### Input:

x : | The x world coord.
y : | The y world coord.
angle : | The angle to be drawn at.
just : | The justification.
text : | The text to be drawn.

### giza_ptext_float

void | giza_ptext_float | (float x, float y, float angle, float just, const char *text) ;

Same functionality as giza_ptext but uses floats.

#### See Also:

giza_ptext

### giza_text

void | giza_text | (double x, double y, const char *text) ;

Draws text at the position (x, y).

#### Input:

x : | The x-coordinate of the bottom left corner of the text.
y : | The y-coordinate of the bottom left corner of the text.
text : | The text to be drawn.

### giza_text_float

void | giza_text_float | (float x, float y, const char *text) ;

Same functionality as giza_text but takes floats.

#### See Also:

giza_text

### giza_qtext

void | giza_qtext | (double x, double y, double angle, double just, const char *text, double xbox[4], double ybox[4]) ;

Returns the co-ordinates of a box bounding the given string if printed by giza_ptext.

#### Input:

x : | The x-coord of the text in world-coords
y : | The y-coord of the text in world-coords
angle : | The angle to draw the text at, in degrees
just : | The horizontal justification of the string. 0. for left-justified, 1. for right-justified
text : | The text to be drawn -xbox :-
ybox : | Set to the world co-ords of the bounding box

### giza_qtext_float

void | giza_qtext_float | (float x, float y, float angle, float just, const char *text, float xbox[4], float ybox[4]) ;

Same as giza_qtext but takes floats

#### See Also:

giza_qtext

### giza_qtextlen

void | giza_qtextlen | (int units, const char *text, double *xlen, double *ylen) ;

Returns the length of a string as would be printed by giza_ptext in a variety of units (added by DJP)

#### Input:

units : | The units in which to return the values
text : | The text to be drawn
xlen : | The length of the text in the x-direction
ylen : | The length of the text in the y-direction

### giza_qtextlen_float

void | giza_qtextlen_float | (int units, const char *text, float *xlen, float *ylen) ;

Same functionality as giza_qtextlen but uses floats

#### See Also:

giza_qtextlen

# Settings

### giza_set_arrow_style

void | giza_set_arrow_style | (int fillStyle, double angle, double cutback) ;

Sets the style of arrow head to be used for arrows drawn with giza_arrow.

#### Input:

fillStyle : | Sets the fill style. See giza_set_fill
angle : | Sets the acute angle of the arrow head. Can range from 0.0 to 90.
cutback : | The fraction of the back of the arrow head that is cut back. 0.0 gives a triangular arrow head, 1.0 gives >.

### giza_set_arrow_style_float

void | giza_set_arrow_style_float | (int fillStyle, float angle, float cutback) ;

Same functionality as giza_set_arrow_style but takes floats instead of doubles.

#### See Also:

giza_set_arrow_style

### giza_get_arrow_style

void | giza_get_arrow_style | (int *fillStyle, double *angle, double *cutback) ;

Queries the current arrow style settings, as set by giza_set_arrow_style.

#### Input:

fillStyle : | Gets set to the current fillstyle.
angle : | Gets set to the current angle.
cutback : | Gets set to the current cutback.

#### See Also:

giza_set_arrow_style

### giza_get_arrow_style_float

void | giza_get_arrow_style_float | (int *fillStyle, float *angle, float *cutback) ;

Same functionality as giza_get_arrow_style, but takes floats instead of doubles.

#### See Also:

giza_get_arrow_style

### giza_set_band_style

void | giza_set_band_style | (int ls, double lw) ;

Sets the line style to be used by giza_band

#### Input:

ls : | the line style for the band
lw : | the width for the line

#### See Also:

giza_band giza_get_band_style

### giza_get_band_style

void | giza_get_band_style | (int *ls, double *lw) ;

Queries the current band style settings to be used by giza_band

#### Output:

ls : | the line style for the band
lw : | the width for the line

#### See Also:

giza_band giza_set_band_style

### giza_begin_buffer

void | giza_begin_buffer | (void) ;

Begins buffering

#### See Also:

giza_end_buffer giza_flush_buffer

### giza_end_buffer

void | giza_end_buffer | (void) ;

Ends buffering

#### See Also:

giza_begin_buffer giza_flush_buffer

### giza_get_buffering

void | giza_get_buffering | (int *buf) ;

returns whether output is currently buffered on current device

#### See Also:

giza_begin_buffer giza_flush_buffer giza_end_buffer

### giza_flush_buffer

void | giza_flush_buffer | (void) ;

Updates graphics display Can be used to flush the graphics buffer manually between calls to giza_begin_buffer and giza_end_buffer

#### See Also:

giza_begin_buffer giza_end_buffer

### giza_set_character_height

void | giza_set_character_height | (double ch) ;

Sets the font size in units of character height.

#### Input:

ch : | the new character height

### giza_set_character_height_float

void | giza_set_character_height_float | (float ch) ;

Same functionality as giza_set_character_height but takes a float

### giza_get_character_height

void | giza_get_character_height | (double *ch) ;

Query the character height

#### Input:

ch : | gets set to the character height.

### giza_get_character_height_float

void | giza_get_character_height_float | (float *ch) ;

Same functionality as giza_get_character_height but takes a float.

#### See Also:

giza_get_character_height

### giza_get_character_size

void | giza_get_character_size | (int units, double *heightx, double *heighty) ;

Returns the character size in a variety of units.

#### Input:

units : | select the units the result will be returned in.
width : | will be set to the width of a character.
height : | will be set to the height of a character.

#### Units:

GIZA_UNITS_NORMALIZED : | normalised device coords.
GIZA_UNITS_WORLD : | world coords.
GIZA_UNITS_PIXELS : | pixels
GIZA_UNITS_DEVICE : | device coords.
GIZA_UNITS_MM : | mm
GIZA_UNITS_INCHES : | inches Other values cause an error message and are treated as GIZA_UNITS_NORMALIZED

### giza_get_character_size_float

void | giza_get_character_size_float | (int units, float *xch, float *ych) ;

Same functionality as giza_get_character_size, but returns the values as floats

### giza_set_colour_index

void | giza_set_colour_index | (int ci) ;

Sets the colour to that represented by the colour index ci. Represented colours can be changed via giza_set_colour_representation.

#### Input:

ci : | The new colour index.

### giza_get_colour_index

void | giza_get_colour_index | (int *ci) ;

Queries the current colour index.

#### Input:

ci : | gets set to the current colour index.

### giza_set_colour_representation

void | giza_set_colour_representation | (int ci, double red, double green, double blue) ;

Allows the user to set the colour represented by the given colour index.

#### Input:

ci : | Which colour index to set.
red : | The red component of the colour (between 0 and 1).
green : | The green component of the colour (between 0 and 1).
blue : | The blue component of the colour (between 0 and 1).

### giza_set_colour_representation_float

void | giza_set_colour_representation_float | (int ci, float red, float green, float blue) ;

Same functionality as giza_set_colour_representation but takes floats/

### giza_set_colour_representation_alpha

void | giza_set_colour_representation_alpha | (int ci, double red, double green, double blue, double alpha) ;

Allows the user to set the colour represented by the given colour index, aswell as the alpha.

#### Input:

ci : | Which colour index to set.
red : | The red component of the colour (between 0 and 1).
green : | The green component of the colour (between 0 and 1).
blue : | The blue component of the colour (between 0 and 1).
alpha : | The alpha used when drawing with this colour index (between 0 and 1).

### giza_set_colour_representation_alpha_float

void | giza_set_colour_representation_alpha_float | (int ci, float red, float green, float blue, float alpha) ;

Same functionality as giza_set_colour_representation_alpha but takes floats.

#### See Also:

giza_set_colour_representation_alpha giza_set_colour_representation

### giza_set_colour_representation_hls

void | giza_set_colour_representation_hls | (int ci, double hue, double lightness, double saturation) ;

Allows the user to set the colour represented by the given colour index This routine accepts colours in the Hue, Lightness and Saturation system.

#### Input:

ci : | Which colour index to set.
hue : | The Hue component of the colour (between 0 and 360 degrees).
lightness : | The Lightness component of the colour (between 0 and 1).
saturation : | The Saturation component of the colour (between 0 and 1).

### giza_set_colour_representation_hls_float

void | giza_set_colour_representation_hls_float | (int ci, float hue, float lightness, float saturation) ;

Same functionality as giza_set_colour_representation_hls but takes floats

### giza_set_colour_representation_rgb

void | giza_set_colour_representation_rgb | (int ci, int red, int green, int blue) ;

Same as giza_set_colour_representation but accepts integer 0->255 instead of double 0->1

#### Input:

ci : | Which colour index to set.
red : | The red component of the colour (between 0 and 255).
green : | The green component of the colour (between 0 and 255).
blue : | The blue component of the colour (between 0 and 255).

#### See Also:

giza_set_colour_representation giza_set_colour_representation_rgba

### giza_set_colour_representation_rgba

void | giza_set_colour_representation_rgba | (int ci, int red, int green, int blue, double alpha) ;

Same as giza_set_colour_representation_alpha but accepts 0->255 instead of 0->1

#### Input:

ci : | Which colour index to set.
red : | The red component of the colour (between 0 and 255).
green : | The green component of the colour (between 0 and 255).
blue : | The blue component of the colour (between 0 and 255).
alpha : | The alpha component of the colour (between 0 and 1)

#### See Also:

giza_set_colour_representation_alpha giza_set_colour_representation_rgb

### giza_set_colour_representation_rgba_float

void | giza_set_colour_representation_rgba_float | (int ci, int red, int green, int blue, float alpha) ;

Same functionality as giza_set_colour_representation_rgba but takes floats

#### See Also:

giza_set_colour_representation_rgba giza_set_colour_representation_alpha

### giza_get_colour_representation

void | giza_get_colour_representation | (int ci, double *red, double *green, double *blue) ;

Query the RGB at a given colour index.

#### Input:

ci : | The index to enquire about
red : | Gets set to the red value at ci (range 0->1)
green : | Gets set to the green value at ci (range 0->1)
blue : | Gets set to the blue value at ci (range 0->1)

### giza_get_colour_representation_alpha

void | giza_get_colour_representation_alpha | (int ci, double *red, double *green, double *blue, double *alpha) ;

Query the RGB and alpha at a given colour index.

#### Input:

ci : | The index to enquire about
red : | Gets set to the red value at ci
green : | Gets set to the green value at ci
blue : | Gets set to the blue value at ci
alpha : | Gets set to the alpha at ci

### giza_set_colour_index_range

void | giza_set_colour_index_range | (int cimin, int cimax) ;

Set the range of colour indices that are affected by giza_set_colour_table

#### Note:

#### Input:

cimin : | lowest colour index in range
cimax : | highest colour index in range

### giza_get_colour_index_range

void | giza_get_colour_index_range | (int *cimin, int *cimax) ;

Queries the current range of colour indices affected by giza_set_colour_table, as set by giza_set_colour_index_range

#### Output:

cimin : | lowest colour index in range
cimax : | highest colour index in range

### giza_set_range_as_colour_table

/*void | giza_set_range_as_colour_table | (int *cimin, int *cimax) ;

Can be used in place of giza_set_colour_table to install the colour table from a predefined set of colour indices

#### See Also:

giza_set_colour_table

### giza_set_colour_palette

void | giza_set_colour_palette | (int palette) ;

Choose between various preset colour "palettes" for the first 16 colour indices commonly used for point and line drawing. This is equivalent to using giza_set_colour_representation for each index in turn.

#### Note:

#### Input:

palette : | choice of colour palette

#### Available palette options:

0 or GIZA_COLOUR_PALETTE_DEFAULT : | default giza palette
1 or GIZA_COLOUR_PALETTE_PGPLOT : | default PGPLOT palette
2 to 4 : | various experimental line palettes
5 : | colourblind safe palette from http://jfly.iam.u-tokyo.ac.jp/color/
6 : | optimum palette from http://web.media.mit.edu/~wad/color/palette.html
7 : | graph-a-licious See Also: giza_set_colour_index, giza_set_colour_table

### giza_set_colour_table

int | giza_set_colour_table | (const double *controlPoints, const double *red, const double *green, const double *blue, int n, double contrast, double brightness) ;

Sets the colour table.

#### Input:

controlPoints : | Specifies at which fraction of the ramp the control points are placed
red : | the normalised value of the red component at each control point
green : | the normalised value of the green component at each control point
blue : | the normalised value of the blue component at each control point
n : | the number of control points
contrast : | contrast of colour ramp (normally 1.0). Use -contrast to reverse direction of ramp
brightness : | brightness of colour ramp (normally 0.5)

#### Return:

0 : | No error.
1 : | An error occurred.

### giza_set_colour_table_float

int | giza_set_colour_table_float | (const float *controlPoints, const float *red, const float *green, const float *blue, int n, float contrast, float brightness) ;

Same functionality as giza_set_colour_table but takes floats

#### See also:

### giza_rgb_from_table

void | giza_rgb_from_table | (double pos, double *red, double *green, double *blue) ;

Gets the rgb values from the colour table corresponding to the fraction of the table.

#### Input:

pos : | The fraction along the table to retrieve the colour from. A value less then 0 is assigned the colour at zero, and above one assigned the colour at one.
red : | Gets set to the red component of the colour at pos.
green : | Gets set to the green component of the colour at pos.
blue : | Gets set to the blue component of the colour at pos.

#### See also:

### giza_rgb_from_table_float

void | giza_rgb_from_table_float | (float pos, float *red, float *green, float *blue) ;

Same functionality giza_rgb_from_table but takes floats

#### See Also:

giza_rgb_from_table giza_set_colour_table

### giza_save_colour_table

void | giza_save_colour_table | (void) ;

Saves the current colour table

#### See Also:

giza_restore_colour_table

### giza_restore_colour_table

void | giza_restore_colour_table | (void) ;

Restores the colour table from a previously saved one

#### See Also:

giza_save_colour_table

### giza_set_environment

void | giza_set_environment | (double xmin, double xmax, double ymin, double ymax, int just, int axis) ;

Sets the plotting environment.

#### Input:

xmin : | The min x value in world coords
xmax : | The max x value in world coords
ymin : | The min y value in world coords
ymax : | The max y value in world coords
just : | Give the x and y axis equal scales
axis : | Options for drawing axis, ticks etc.

#### Axis:

-4 : | draw box and major tick marks only
-3 : | draw box and tick marks (major and minor) only
-2 : | no axis, no box, no labels
-1 : | draw the box only
0 : | draw a box and label it with world coords
1 : | same as 0 but also draw the axis
2 : | same as 1 but also draw grid lines at major intervals
10 : | draw box and label X-axis logarithmically
20 : | draw box and label Y-axis logarithmically
30 : | draw box and label X- and Y-axis logarithmically

### giza_set_environment_float

void | giza_set_environment_float | (float xmin, float xmax, float ymin, float ymax, int just, int axis) ;

Same functionality as giza_set_environment but takes floats

### giza_set_fill

void | giza_set_fill | (int fs) ;

Sets the current fill style.

#### Input:

fs : | the new fill style

#### Fill Styles:

1 or GIZA_FILL_SOLID : | solid
2 or GIZA_FILL_HOLLOW : | hollow
3 or GIZA_FILL_HATCH : | hatch
4 or GIZA_FILL_CROSSHATCH : | crosshatch

### giza_get_fill

void | giza_get_fill | (int *fs) ;

Query the current fill style.

#### Input:

fs : | gets set to the current fill style.

### giza_set_hatching_style

void | giza_set_hatching_style | (double angle, double spacing, double phase) ;

Sets the hatching style when using GIZA_FILL_HATCH

#### Input:

angle : | the angle of the hatching pattern with respect to the horizontal
spacing : | the line spacing, in units of the default (1.0)
phase : | a number between 0.0 and 1.0 specifying the offset along the horizontal axis to start the hatching lines

#### See Also:

giza_fill giza_get_hatching_style

### giza_set_hatching_style_float

void | giza_set_hatching_style_float | (float angle, float spacing, float phase) ;

Same as giza_set_hatching_style, but takes floats

### giza_get_hatching_style

void | giza_get_hatching_style | (double *angle, double *spacing, double *phase) ;

Queries the current hatching style wgen using GIZA_FILL_HATCH

#### Output:

angle : | the angle of the hatching pattern with respect to the horizontal
spacing : | the line spacing, in units of the default (1.0)
phase : | a number between 0.0 and 1.0 specifying the offset along the horizontal axis to start the hatching lines

#### See Also:

giza_fill giza_set_hatching_style

### giza_get_hatching_style_float

void | giza_get_hatching_style_float | (float *angle, float *spacing, float *phase) ;

Same as giza_get_hatching_style, but takes floats

### giza_begin_autolog

void giza_begin_autolog (void) |  | ;

Turns on automatic logging of interactive devices This writes a png file every time the page is changed in an interactive device, with a name based on the current date/time (giza-%Y-%M-%D-%H:%M:%S.png). Logging can also be turned on by setting the GIZA_LOG environment variable.

#### See Also:

giza_end_autolog

### giza_end_autolog

void giza_end_autolog (void) |  | ;

Turns off automatic logging feature.

#### See Also:

giza_begin_autolog

### giza_set_line_cap

void | giza_set_line_cap | (int lc) ;

Sets the line cap.

#### Input:

lc : | An integer representing the line cap.

#### Options:

0 : | butt
1 : | round
2 : | square

### giza_get_line_cap

void | giza_get_line_cap | (int *lc) ;

Gets the current line cap, as set by giza_set_line_cap.

#### Input:

lc : | gets set to the current line cap.

### giza_set_line_style

void | giza_set_line_style | (int ls) ;

Sets the current line style.

#### Input:

ls : | the new line style

#### Line Styles:

GIZA_LS_SOLID : | solid
GIZA_LS_LONG_DASH : | long dash
GIZA_LS_SHORT_DASH : | short dash
GIZA_LS_DOT : | dot
GIZA_LS_DASH_DOT : | dash dot
GIZA_LS_DASH_DOT_DOT_DOT : | dash dot dot dot

### giza_get_line_style

void | giza_get_line_style | (int *ls) ;

Query the current line style.

#### Input:

ls : | gets set to the current line style

### giza_set_line_width

void | giza_set_line_width | (double lw) ;

Sets the line width for all subsequent drawing.

#### Input:

lw : | The new line width. 1 is 1/4 of a millimetre.

### giza_set_line_width_float

void | giza_set_line_width_float | (float lw) ;

Same functionality as giza_set_line_width but uses floats

#### See Also:

giza_set_line_width

### giza_get_line_width

void | giza_get_line_width | (double *lw) ;

Queries the current line width.

#### Input:

lw : | gets set to the current line width.

### giza_start_prompting

void | giza_start_prompting | (void) ;

Turns on prompting for current device, i.e. the user will be prompted before a page change or a device being closed.

#### See Also:

giza_stop_prompting

### giza_stop_prompting

void | giza_stop_prompting | (void) ;

Turns off prompting, i.e. the user will not be prompted before a page change or a device being closed.

#### See Also:

giza_start_prompting

### giza_save

void | giza_save | (void) ;

Saves current plot settings

#### See Also:

giza_restore

### giza_restore

void | giza_restore | (void) ;

Restores plot settings stored via giza_save

#### See Also:

giza_save

### giza_set_font

void | giza_set_font | (const char *font) ;

Sets the current font to the family specified in font, otherwise it is unchanged.

#### Input:

font : | the font family to be used.

### giza_set_font_bold

void | giza_set_font_bold | (const char *font) ;

Sets the current font to the family specified in font, otherwise it is unchanged.

#### Input:

font : | the font family to be used.

### giza_set_font_italic

void | giza_set_font_italic | (const char *font) ;

Sets the current font to the family specified in font, otherwise it is unchanged.

#### Input:

font : | the font family to be used.

### giza_set_font_bold_italic

void | giza_set_font_bold_italic | (const char *font) ;

Sets the current font to the family specified in font, otherwise it is unchanged.

#### Input:

font : | the font family to be used.

### giza_get_font

void | giza_get_font | (char *font, int n) ;

Sets the current font to the family specified in font, otherwise it is unchanged.

#### Input:

font : | Gets set to the current font family
n : | The length of memory allocated to font

#### See Also:

giza_set_font

### giza_set_text_background

void | giza_set_text_background | (int colourIndex) ;

Set the colour index for the background of any text to be drawn. Use a negative value for a transparent background.

#### Input:

colourIndex : | The colour index the background will be.

### giza_get_text_background

void | giza_get_text_background | (int *colourIndex) ;

Queries the current text background colour

#### Output:

colourIndex : | Current setting for the background text colour.

### giza_version

void | giza_version | (int *major, int *minor, int *micro) ;

Returns the giza version. Note that version information can also be obtained using the header variables GIZA_VERSION_STRING, GIZA_VERSION_MAJOR, GIZA_VERSION_MINOR and GIZA_VERSION_MICRO. These are available in the Fortran interface also.

#### Output:

major : | major version number
minor : | minor version number
micro : | micro version number

### giza_set_viewport

void | giza_set_viewport | (double xleft, double xright, double ybottom, double ytop) ;

Changes the size and position of the viewport, all arguments are in normalised device coordinates. The viewport is the region of the device that can be drawn to.

#### Input:

xleft : | The x coordinate of the left edge of the viewport
xright : | The x coordinate of the right edge of the viewport
ybottom : | The y coordinate of the bottom edge of the viewport
ytop : | The y coordinate of the top edge of the viewport

### giza_set_viewport_float

void | giza_set_viewport_float | (float xleft, float xright, float ybottom, float ytop) ;

Same functionality as giza_set_viewport but takes floats

#### See Also:

giza_set_viewport

### giza_get_viewport

void | giza_get_viewport | (int units, double *x1, double *x2, double *y1, double *y2) ;

Returns the viewport size and position.

#### Input:

units : | specify the units to return values in.
x1 : | set to x-coord of upper-left corner
x2 : | set to x-coord of lower-right corner
y1 : | set to y-coord of upper-left corner
y2 : | set to y-coord of lower-right corner

#### Units:

0 or GIZA_UNITS_NORMALIZED : | normalised device units
1 or GIZA_UNITS_INCHES : | inches
2 or GIZA_UNITS_MM : | mm
3 or GIZA_UNITS_PIXELS : | pixels
5 or GIZA_UNITS_DEVICE : | device units (pixels or points)
default : | normalised device units

### giza_get_viewport_float

void | giza_get_viewport_float | (int units, float *x1, float *x2, float *y1, float *y2) ;

Same functionality as giza_get_viewport but uses floats

#### See Also:

giza_get_viewport

### giza_set_viewport_default

void | giza_set_viewport_default | (void) ;

Sets the viewport to the default settings

#### See Also:

giza_set_viewport

### giza_set_viewport_inches

void | giza_set_viewport_inches | (double xleftin, double xrightin, double ybottomin, double ytopin) ;

Sets the viewport size in inches

#### See Also:

giza_set_viewport

### giza_set_viewport_inches_float

void | giza_set_viewport_inches_float | (float xleftin, float xrightin, float ybottomin, float ytopin) ;

Same as giza_set_viewport_inches but takes floats

#### See Also:

giza_set_viewport_inches

### giza_start_warnings

void | giza_start_warnings | (void) ;

Warnings will be printed to stderr.

#### See Also:

giza_stop_warnings

### giza_stop_warnings

void | giza_stop_warnings | (void) ;

Warnings will not be printed to stderr.

#### See Also:

giza_start_warnings

### giza_set_window

void | giza_set_window | (double x1, double x2, double y1, double y2) ;

Sets the limits of the axis.

#### Input:

x1 : | the lowest value of the x axis
x2 : | the highest value of the x axis
y1 : | the lowest value of the y axis
y2 : | the highest value of the y axis

### giza_set_window_float

void | giza_set_window_float | (float x1, float x2, float y1, float y2) ;

Same functionality as giza_set_window but uses floats.

#### See Also:

giza_set_window

### giza_set_window_equal_scale

void | giza_set_window_equal_scale | (double x1, double x2, double y1, double y2) ;

Sets the window so the x axis ranges from x1 to x2 and y from y1 to y2, then adjusts the view port to the largest possible size that that allows the axis have equal scales.

#### Input:

x1 : | the lowest value of the x axis
x2 : | the highest value of the x axis
y1 : | the lowest value of the y axis
y2 : | the highest value of the y axis

### giza_set_window_equal_scale_float

void | giza_set_window_equal_scale_float | (float x1, float x2, float y1, float y2) ;

Same functionality as giza_set_window_equal_scale but uses floats

#### See Also:

giza_set_window_equal_scale

### giza_get_window

void | giza_get_window | (double *x1, double *x2, double *y1, double *y2) ;

Query the boundaries of the window in world coords

#### Input:

x1 : | Gets set to the lowest value of the x axis
x2 : | Gets set to the highest value of the x axis
y1 : | Gets set to the lowest value of the y axis
y2 : | Gets set to the highest value of the y axis

### giza_get_window_float

void | giza_get_window_float | (float *x1, float *x2, float *y1, float *y2) ;

Same functionality as giza_get_window but uses floats

# Interactive

### giza_band

int | giza_band | (int mode, int moveCurs, double xanc, double yanc, double *x, double *y, char *ch) ;

Returns the cursor position and character typed by the user relative to an anchor point

#### Input:

mode : | selects the type of shape to draw during input
moveCurs : | if 1 the cursor is moved to (x, y), if 0 the cursor is not moved.
xanc : | the x-coord of the anchor point.
yanc : | the y-coord of the anchor point.
x : | Gets set the position of the cursor.
y : | Gets set to the position of the cursor.
ch : | Gets set to the character pressed by the user.

#### Return:

1 : | The device has no cursor
0 : | The call was successful

#### Modes:

0 or GIZA_BAND_NONE : | None, behaves like giza_get_key_press
1 or GIZA_BAND_LINE : | Straight line drawn from anchor point
2 or GIZA_BAND_RECTANGLE : | Hollow rectangle
3 or GIZA_BAND_HORZLINES : | Two horizontal lines
4 or GIZA_BAND_VERTLINES : | Two vertical lines
5 or GIZA_BAND_HORZLINE : | Single horizontal line, ignores anchor point
6 or GIZA_BAND_VERTLINE : | Single vertical lines, ignores anchor point
7 or GIZA_BAND_CROSSHAIR : | Cross hair, ignores anchor point
8 or GIZA_BAND_CIRCLE : | Circle centred on anchor point

#### See Also:

giza_get_key_press

### giza_band_float

int | giza_band_float | (int mode, int moveCurs, float xanc, float yanc, float *x, float *y, char *ch) ;

Same functionality as giza_band, but uses floats.

#### See Also:

giza_band

### giza_mark_points

void | giza_mark_points | (int maxpts, int *npts, double* xpts, double* ypts, int symbol) ;

Mark a set of points using the cursor

#### Input:

maxpts : | maximum number of points that may be accepted
symbol : | symbol code for drawing points

#### Input/Output:

xpts : | the x-coord of the points
ypts : | the y-coord of the anchor point.
npts : | number of points entered, should be zero on first call

#### See Also:

giza_points

### giza_mark_points_float

void | giza_mark_points_float | (int maxpts, int *npts, float* xpts, float* ypts, int symbol) ;

Same functionality as giza_mark_points, but takes floats

#### See Also:

giza_mark_points

### giza_mark_points_ordered

void | giza_mark_points_ordered | (int maxpts, int *npts, double* xpts, double* ypts, int symbol) ;

Mark a set of points using the cursor

#### Input:

maxpts : | maximum number of points that may be accepted
symbol : | symbol code for drawing points

#### Input/Output:

xpts : | the x-coord of the points
ypts : | the y-coord of the anchor point.
npts : | number of points entered, should be zero on first call

#### Note:

#### See Also:

giza_points

### giza_mark_points_ordered_float

void | giza_mark_points_ordered_float | (int maxpts, int *npts, float* xpts, float* ypts, int symbol) ;

Same functionality as giza_mark_points_ordered, but takes floats

#### See Also:

giza_mark_points

### giza_mark_line

void | giza_mark_line | (int maxpts, int *npts, double* xpts, double* ypts) ;

Mark a set of points using the cursor

#### Input:

maxpts : | maximum number of points that may be accepted

#### Input/Output:

xpts : | the x-coord of the points
ypts : | the y-coord of the anchor point.
npts : | number of points entered, should be zero on first call

#### See Also:

giza_mark_points

### giza_mark_points_float

void | giza_mark_line_float | (int maxpts, int *npts, float* xpts, float* ypts) ;

Same functionality as giza_mark_line, but takes floats

#### See Also:

giza_mark_line giza_mark_points giza_mark_line_ordered

### giza_mark_line_ordered

void | giza_mark_line_ordered | (int maxpts, int *npts, double* xpts, double* ypts) ;

Mark a set of points using the cursor

#### Input:

maxpts : | maximum number of points that may be accepted

#### Input/Output:

xpts : | the x-coord of the points
ypts : | the y-coord of the anchor point.
npts : | number of points entered, should be zero on first call

#### Note:

#### See Also:

giza_mark_line giza_mark_points

### giza_mark_line_ordered_float

void | giza_mark_line_ordered_float | (int maxpts, int *npts, float* xpts, float* ypts) ;

Same functionality as giza_mark_line_ordered, but takes floats

#### See Also:

giza_mark_points

### giza_mark_line_char

void | giza_mark_line_char | (int maxpts, int *npts, double* xpts, double* ypts, char *ch) ;

Same functionality as giza_mark_line, but also returns last character pressed

#### See Also:

giza_mark_line

### giza_mark_points_float

void | giza_mark_line_char_float | (int maxpts, int *npts, float* xpts, float* ypts, char *ch) ;

Same functionality as giza_mark_line, but takes floats

#### See Also:

giza_mark_line giza_mark_points giza_mark_line_ordered

### giza_get_key_press

int | giza_get_key_press | (double *x, double *y, char *ch) ;

Returns the cursor position and key press after a key press.

#### Input:

x : | Gets set to the x world coord of the cursor.
y : | Gets set to the y world coord of the cursor.
ch : | Gets set to the character pressed.

#### Return value:

0 : | If the call was successful
1 : | If the device has no cursor