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. |
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"
cpl_error_code cpl_plot_bivector | ( | const char * | pre, | |
const char * | options, | |||
const char * | post, | |||
const cpl_bivector * | bivector | |||
) |
Plot a bivector.
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 |
cpl_mplot_open()
.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.
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 |
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.
cpl_mplot_open()
.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.
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 |
cpl_mplot_open()
.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.
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 |
cpl_mplot_open()
.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.
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 |
cpl_image_open()
.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.
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 |
lastcol shall be greater than or equal to firstcol.
cpl_mplot_open()
.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.
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 |
lastrow shall be greater than or equal to firstrow.
cpl_mplot_open()
.cpl_error_code cpl_plot_vector | ( | const char * | pre, | |
const char * | options, | |||
const char * | post, | |||
const cpl_vector * | vector | |||
) |
Plot a vector.
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 |
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.
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 |
The non-NULL vectors must have the same number of elements. The first vector gives the x-axis. If NULL, the index is used.
cpl_mplot_open()
.