Plotting functionalities


Functions

cpl_error_code cpl_plot_bivector (const char *pre, const char *options, const char *post, const cpl_bivector *bivector)
 Plot a bivector.
cpl_error_code cpl_plot_bivectors (const char *pre, const char **options, const char *post, const cpl_bivector **bivectors, int nbvec)
 Plot an array of bivectors.
cpl_error_code cpl_plot_column (const char *pre, const char *options, const char *post, const cpl_table *tab, const char *xlab, const char *ylab)
 Plot a column of a table.
cpl_error_code cpl_plot_columns (const char *pre, const char *options, const char *post, const cpl_table *tab, const char **labels, int nlabels)
 Plot severals column of a table.
cpl_error_code cpl_plot_image (const char *pre, const char *options, const char *post, const cpl_image *image)
 Plot an image.
cpl_error_code cpl_plot_image_col (const char *pre, const char *options, const char *post, const cpl_image *image, int firstcol, int lastcol, int colstep)
 Plot a range of image columns.
cpl_error_code cpl_plot_image_row (const char *pre, const char *options, const char *post, const cpl_image *image, int firstrow, int lastrow, int rowstep)
 Plot a range of image rows.
cpl_error_code cpl_plot_vector (const char *pre, const char *options, const char *post, const cpl_vector *vector)
 Plot a vector.
cpl_error_code cpl_plot_vectors (const char *pre, const char *options, const char *post, const cpl_vector **vectors, int nvec)
 Plot an array of vectors.

Detailed Description

This module provides functions to plot basic CPL objects

This module is offered to help during the development process. The functions offered should NOT be used in any operational environment. For that reason, the support of those remains limited, and no functionality extension can be expected from the CPL team.

The created plot windows can be closed by pressing the 'q' key like you would do with a normal gnuplot window.

The default behaviour of the plotting is to use gnuplot (with option -persist). The user can control the actual plotting-command used to create the plot by setting the environment variable CPL_PLOTTER. Currently, if CPL_PLOTTER is set it must contain the string 'gnuplot'. Setting it to 'cat > my_gnuplot_$$.txt' causes a number of ASCII-files to be created, which each produce a plot when given as standard input to gnuplot.

A finer control of the plotting options can be obtained by writing an executable script, e.g. my_gnuplot, that executes gnuplot after setting the desired gnuplot options (e.g. set terminal pslatex color) and then setting CPL_PLOTTER to my_gnuplot.

Images can be plotted not only with gnuplot, but also using the pnm format. This is controlled with the environment variable CPL_IMAGER. If CPL_IMAGER is set to a string that does not contain the word gnuplot, the recipe will generate the plot in pnm format. E.g. setting CPL_IMAGER to 'display - &' will produce a gray-scale image using the image viewer display.

   #include "cpl_plot.h"

Function Documentation

cpl_error_code cpl_plot_bivector ( const char *  pre,
const char *  options,
const char *  post,
const cpl_bivector *  bivector 
)

Plot a bivector.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
bivector The bivector to plot
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
The bivector must have a positive number of elements.

See also:
also cpl_mplot_open().
Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_bivectors ( const char *  pre,
const char **  options,
const char *  post,
const cpl_bivector **  bivectors,
int  nbvec 
)

Plot an array of bivectors.

Parameters:
pre An optional string with pre-plot commands
options Array of strings with plotting options
post An optional string with post-plot commands
bivectors The bivectors array to plot
nbvec The number of bivectors, at least one is required
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
Each bivector in the array defines a sequence of points to be plotted. The bivectors can have different size.

The options array must be of same size as the bivectors array. The i'th string in the array specifies the plotting options for the i'th bivector.

See also:
also cpl_mplot_open().
Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_column ( const char *  pre,
const char *  options,
const char *  post,
const cpl_table *  tab,
const char *  xlab,
const char *  ylab 
)

Plot a column of a table.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
tab The table to plot
xlab The label of the column used in x
ylab The label of the column used in y
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
See also:
also cpl_mplot_open().
If xlab is NULL, the sequence number is used for X.

Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_columns ( const char *  pre,
const char *  options,
const char *  post,
const cpl_table *  tab,
const char **  labels,
int  nlabels 
)

Plot severals column of a table.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
tab The table to plot
labels The labels of the columns
nlabels The number of labels
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
See also:
also cpl_mplot_open().
If xlab is NULL, the sequence number is used for X.

Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_image ( const char *  pre,
const char *  options,
const char *  post,
const cpl_image *  image 
)

Plot an image.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
image The image to plot
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
The image must have a positive number of pixels.

See also:
also cpl_image_open().
If the specified plotting command does not contain the string 'gnuplot', the plotting command is assumed to be able to parse a pgm (P5) image from stdin. Valid examples of such a command may include 'cat > myplot$$.pgm' and 'display - &'.

The 'pre' and 'post' commands are ignored in PGM-plots, while the 'options' string is written as a comment in the header of the image.

See also cpl_plot_vector().

Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_image_col ( const char *  pre,
const char *  options,
const char *  post,
const cpl_image *  image,
int  firstcol,
int  lastcol,
int  colstep 
)

Plot a range of image columns.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
image The image to plot
firstcol The first column to plot (1 for first)
lastcol The last column to plot
colstep The positive column stride
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
The image must have a positive number of pixels.

lastcol shall be greater than or equal to firstcol.

See also:
also cpl_mplot_open().
Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_image_row ( const char *  pre,
const char *  options,
const char *  post,
const cpl_image *  image,
int  firstrow,
int  lastrow,
int  rowstep 
)

Plot a range of image rows.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
image The image to plot
firstrow The first row to plot (1 for first)
lastrow The last row to plot
rowstep The positive row stride
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
The image must have a positive number of pixels.

lastrow shall be greater than or equal to firstrow.

See also:
also cpl_mplot_open().
Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_vector ( const char *  pre,
const char *  options,
const char *  post,
const cpl_vector *  vector 
)

Plot a vector.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
vector The vector to plot
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
The vector must have a positive number of elements.

Possible _cpl_error_code_ set in this function:

cpl_error_code cpl_plot_vectors ( const char *  pre,
const char *  options,
const char *  post,
const cpl_vector **  vectors,
int  nvec 
)

Plot an array of vectors.

Parameters:
pre An optional string with pre-plot commands
options An optional string with plotting options
post An optional string with post-plot commands
vectors The vectors array to plot
nvec The number of vectors
Returns:
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
The array should contain at least 3 vectors, the first one can be NULL.

The non-NULL vectors must have the same number of elements. The first vector gives the x-axis. If NULL, the index is used.

See also:
also cpl_mplot_open().
Possible _cpl_error_code_ set in this function:


Generated on Wed Mar 18 09:40:12 2009 for Common Pipeline Library Reference Manual by  doxygen 1.4.7