Term-Gnuplot

 view release on metacpan or  search on metacpan

Gnuplot.pm  view on Meta::CPAN

=item pattern_fill_box($pattern, $xleft, $ybottom, $width, $height)

Fills box; $pattern is a small plot-terminal dependent integer.  For many
terminals linetype() means color; then the current color is used as the
foreground color.

=item color_fill_box($intensity, $xleft, $ybottom, $width, $height)

Fills box with a half-tone color; $intensity changes between 0 and 1.
The corresponding solid color is as above.

=item make_gray_palette()

Should be called before any filled-rectangle operation is called

=item set_color($color)

$color is a floating point number between 0 and 1.  Currently only gray-scale
palette is supported, so the semantic of this number is the brightness.

=item previous_palette()

does not make a lot of sense until user-settable palettes are present.

=item filled_polygon($xy_coordinates)

takes a list of integers describing x- and y- coordinates of the vertices
of a polygon (x and y alternating).  Uses the color set by set_color().

=item put_right_justified_text(), put_centered_text(), put_left_justified_text()

Same as put_text(), but provide terminal-independent justification too.  The
setting of justification is preserved.

May be used in presence of text rotation too..

=back

B<NOTE.> Some terminals I<require> calling set_options() before init()!
Similarly, in some situation it is required to call linewidth() and linetype()
at the start of plot.

=head1 gnuplot F<term/README>

DOCUMENTATION FOR GNUPLOT TERMINAL DRIVER WRITERS

By Russell Lang 1/90

Updated for new file layout by drd 4/95

Paragraphs about inclusion of TERM_HELP added by rcc 1/96

No change to the interface between gnuplot and the terminal drivers,
but we would like to make the terminal drivers standalone

1) in order move the support for the terminal drivers outside of the
   support for the main program, thereby encouraging a library of
   contributed drivers
2) To make it easy for users to add contributed drivers, by adding
   a single #include line to term.h
3) To allow individual compilation on DOS, to save the overlay
   manager from having to load _all_ drivers together.

CORRECTION - scale() interface is no longer supported, since it
is incompatible with multiplot.

Whole of terminal driver should be contained in one <driver>.trm file,
with a fairly strict layout as detailed below - this allows the
gnuplot maintainers to change the way the terminal drivers are
compiled without having to change the drivers themselves.

term.h, and therefore each file.trm file, may be loaded more than once,
with different sections selected by macros.

Each driver provides all the functions it needs, and a table of
function pointers and other data to interface to gnuplot.
The table entry is currently defined as follows in plot.h:

  struct TERMENTRY {

  /* required entries */

	char *name;
	char *description;
	unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;

	void (*options) __PROTO((void));
	void (*init) __PROTO((void));
	void (*reset) __PROTO((void));
	void (*text) __PROTO((void));
	int (*scale) __PROTO((double, double));
	void (*graphics) __PROTO((void));
	void (*move) __PROTO((unsigned int, unsigned int));
	void (*vector) __PROTO((unsigned int, unsigned int));
	void (*linetype) __PROTO((int));
	void (*put_text) __PROTO((unsigned int, unsigned int,char*));

  /* optional entries */

	int (*text_angle) __PROTO((int));
	int (*justify_text) __PROTO((enum JUSTIFY));
	void (*point) __PROTO((unsigned int, unsigned int,int));
	void (*arrow) __PROTO((unsigned int, unsigned int, unsigned int,
			   unsigned int, int));
   int (*set_font) __PROTO((char *font));  /* "font,size" */
	void (*set_pointsize) __PROTO((double size)); /* notification of set pointsize */
	int flags; /* various flags */
   void (*suspend) __PROTO((void)); /* after one plot of multiplot */
   void (*resume) __PROTO((void));  /* before subsequent plot of multiplot */
   void (*boxfill) __PROTO((int style, unsigned int x1, unsigned int y1, unsigned int width, unsigned int height)); /* clear part of multiplot */
   void (*linewidth) __PROTO((double linewidth));
   void (*pointsize) __PROTO((double pointsize));
  };

One consequence of (1) is that we would like drivers to be backwards
compatible - drivers in the correct form below should work in future
versions of gnuplot without change. C compilers guarantee to fill
unitialised members of a structure to zero, so gnuplot can detect old
drivers, in which fields have not been initalised, and can point
new interface entry pointers to dummy functions.



( run in 0.839 second using v1.01-cache-2.11-cpan-df04353d9ac )