PLOT(3) AerieBSD 1.0 Refernce Manual PLOT(3)

NAME

plot — Plotting library

SYNOPSIS

#include <plot.h>

void* plot_open(const char *tty, FILE *fp);

int plot_close(void *v);

int plot_arc(void *v, int x, int y, int x0, int y0, int x1, int y1);

int plot_circle(void *v, int x, int y, int r);

int plot_cont(void *v, int x, int y);

int plot_dot(void *v, int x, int y, int dx, int n, const int *pat);

int plot_erase(void *v);

int plot_label(void *v, const char *s);

int plot_line(void *v, int x, int y, int x1, int y1);

int plot_linemod(void *v, int mod);

int plot_move(void *v, int x, int y);

int plot_point(void *v, int x, int y);

int plot_space(void *v, int x0, int y0, int x1, int y1);

DESCRIPTION

plot provides a portable high level interface to plotters and other drawing devices (such as PostScript file format).

ROUTINES

plot_open(const char *tty, FILE *fp);
Allocate and initialise plotting context (that is returned as an opaque void*) for plotter type given in tty argument and using output file given in the fp argument. Either of arguments can be NULL in which case default will be assumed that is PLOTCAP or TERM environment variable contents for plotter specification and stdout for the output stream. If the initialisation sequence is specified it will be put out.

plot_close(void *v);
Put out the finilasing sequence should one be specified for the given plotter type and free the plotting context. For the dumb mode the resulting image is output at this time as well. The output file pointer is left open.

plot_arc(void *v, int x, int y, int x0, int y0, int x1, int y1);
Draw an arc with centre in [x, y] and endpoints specified in [x0, y0] and [x1, y1]].

plot_circle(void *v, int x, int y, int r);
Draw a circle with centre in [x, y] and of radius r.

plot_cont(void *v, int x, int y);
Draw a straight line form current position to [x, y] and change the current position to there as well.

plot_dot(void *v, int x, int y, int dx, int n, const int *pat);
Draw a dot at [x, y] of size n and using pattern pat. Current position is changed accordignly.

plot_erase(void *v);
Erase whole shit and reset current position to the plotter's default.

plot_label(void *v, const char *s);
Print a label from string s using whatever plotter's default font is.

plot_line(void *v, int x, int y, int x1, int y1);
Draw a straight line between points [x, y] and [x1, y1] using current selected line mode (set with plot_linemod)). Current position is set to [x1, y1]].

plot_linemod(void *v, int mod);
Set line drawing mode to mod specified. Currently only values 0 through 8 are supported. The value of 0 resets the mode to the plotter's default.

plot_move(void *v, int x, int y);
Change current position to [x, y]].

plot_point(void *v, int x, int y);
Pitch a point at [x, y] and change current position accordingly.

plot_space(void *v, int x0, int y0, int x1, int y1);
Set the system of coordinates and change the drawing size if supported or otherwise scale to the closest matching supported size. Values are allowed to be negative.

RETURN VALUES

plot_open returns NULL upon error. All the other functions return 0 on success and -1 on error.

ENVIRONMENT

PLOTCAP
environment variable is checked upon first to contain plotter (see plotcap(5)) specification.
TERM
environment variable is used to determine the plotter type to use (see plotcap(5)) to fetch description for from the plotcap database.

FILES

/usr/share/misc/plotcap
Plotters descriptions.

EXAMPLES

ERRORS

[EINVAL]
Invalid arguments specified.
[ENOMEM]
No memory to allocate.
[EOPNOTSUPP]
No operation is found in the plotcap database and cannot emulate.
See also stdio(3) and getcap(3) for other possible errors returned.

SEE ALSO

cap_mkdb(1), graph(1), plot(1), spline(1), getcap(3), malloc(3), plot(5), plotcap(5)

HISTORY

The plot library first appeared in Version 6 AT&T UNIX.

This implementaion however is different and first appeared in ÆrieBSD 1.0.

AUTHORS

The plot library was written by Michael Shalayeff ‹mickey@lucifier.net›.

CAVEATS

Library functions take the best effort to draw the primitives requested including descending to simpler or otherwise rasing to more complex primitives should there be no definition for direct implementation such as: It is made sure however that endless recursion does not happen.


AerieBSD 1.0 Reference Manual October 23 2009 PLOT(3)