Line (and Point) Plots

These methods are used for creating line and point plots of data associated with one-dimensional arrays of double precision values. All commands are variants (which differ by their input arguments) of the plot method. The plotting of solid curves, markers, or curves with markers is specified using different combinations of arguments to the plot method. Other aspects of plotting, e.g. line color and width, are set with the plot format control routines.

Samples : gpsmp1.cpp, gpsmp2.cpp


Line (and Point) Plot Commands

plot(y,n) plots the n values of y verses their index.
plot(y,n,c) plot as points the n values of y using point type c.
plot(y,n,c,s) plot(y,n,c) using the plot style s.
plot(x,y,n) plots the n values of y vs. the n values of x.
plot(x,y,n,c) plots as points (using the character c) the n values of y vs. the n values of x.
plot(x,y,n,c,s) plot(x,y,n,c) using the plot style s.
plot() Recreates a plot using data from the previous plotting command and current settings.
x and y are C++ double arrays of size n, c is a character value and s is a CAMgraphicsProcess plotstyle value.

CAMgraphicsProcess Line Plot Style Constants

CAMgraphicsProcess::CURVE = 0
CAMgraphicsProcess::POINTS = 1
CAMgraphicsProcess::CURVE_AND_POINTS = 2


Line and (Point) Plot Format Control

Aspects of the line/point styles (color, width, size, etc.) are set with the following methods

setPlotLineColor(int c) The line color is set to the color constant c
setPlotDashPattern(int d) The dash pattern is set to the pattern specified by the dash constant d
setPlotLineWidth(double w) The width of lines drawn (specified as a fraction of the drawing window) is set to w. Default = .001.
setPlotPointType(char p) The symbol used for plotting points is set to p. Default = '*'.
setPlotPointSize(double d) The width of character symbol used (specified as a fracton of the drawing window) is set to d. Default = .02.
restorePlotDefaults() Restores settings to their default values.

CAMgraphicsProcess Dash Type Constants

CAMgraphicsProcess::SOLID= 0 CAMgraphicsProcess::DASH_DOT = 4
CAMgraphicsProcess::DASH = 1 CAMgraphicsProcess::DASH_DOUBLE_DOT= 5
CAMgraphicsProcess::DOUBLE_DASH = 2 CAMgraphicsProcess::DOTS= 6

CAMgraphicsProcess Line Color Constants

CAMgraphicsProcess::BLACK = 0 CAMgraphicsProcess::RED = 9
CAMgraphicsProcess::DARK_GREY = 1 CAMgraphicsProcess::LIGHT_RED = 10
CAMgraphicsProcess::LIGHT_GREY = 2 CAMgraphicsProcess::MAGENTA = 11
CAMgraphicsProcess::BLUE = 3 CAMgraphicsProcess::LIGHT_MAGENTA = 12
CAMgraphicsProcess::LIGHT_BLUE = 4 CAMgraphicsProcess::ORANGE = 13
CAMgraphicsProcess::GREEN = 5 CAMgraphicsProcess::YELLOW = 14
CAMgraphicsProcess::LIGHT_GREEN = 6 CAMgraphicsProcess::WHITE = 15
CAMgraphicsProcess::CYAN = 7  
CAMgraphicsProcess::LIGHT_CYAN = 8