PlotGrid
Defines a frame and draws horizontal and vertical grid lines within this frame. These grid lines can then be used by the PlotLine(), PlotXYLine(), and PlotScaleMarker() functions. You need to define the frame for a plot before you can plot points with the PlotLine() and PlotXYLine() functions. nSamples specifies the maximum number of samples that can be plotted for a single line. If you set FrameWidth to 0 (zero), the frame will be defined but not displayed (however, the plot will still be displayed).
You can specify the number of grid lines and their color, as well as the background color which will fill the frame. If nHorGrid and nVerGrid are set to 0 (zero), then the grid lines will not be drawn.
you need to call the PlotOpen() function, first, to get the handle for the plot (hPlot), and to specify the output device. Then call this function to set up the frame and grid. You can then call the PlotScaleMarker() function to draw scale lines beside the frame, and call the PlotLine() or PlotXYLine() to plot a set of data points.
Syntax
PlotGrid(hPlot, nSamples, X1, Y1, X2, Y2, nHorGrid, HorGridCol, nVerGrid, VerGridCol, FrameWidth, FrameCol, nFill, nMode)
hPlot:
Plot handle, returned from the PlotOpen() function. The plot handle identifies the table where data on the plot is stored.
nSamples:
The maximum number of samples that can be plotted for a single line in this grid (valid values between 2 and 16000 inclusive). For example, if you set nSamples to 10, then plot 2 lines in this grid (using the PlotLine() function), each line will be plotted with a maximum of 10 samples. For this example, a line can possess less than 10 samples, but if it has more, it will be shortened to 10 samples.
X1, Y1:
The x and y coordinates of the upper-left corner of the frame containing the grid lines.
X2, Y2:
The x and y coordinates of the lower-right corner of the frame containing the grid lines.
If the plot is for display on the screen, you should set (X1,Y1) to (0,0). The origin of the frame is then positioned at the AN specified in the PlotOpen() function.
If the output device is a printer, both (X1,Y1) and (X2,Y2) are relative to the point (0,0).
nHorGrid:
The number of rows (formed by the horizontal grid lines) to draw within the frame. If there is no need of grid lines, set nHorGrid to 0 (zero) and HorGridCol to 0. nHorGrid cannot exceed the pixel width of the plot.
HorGridCol:
The color of the horizontal grid lines (flashing color is not supported). Select a color from the list of Predefined Color Names and Codes or create an RGB-based color using the function MakeCitectColor.
nVerGrid:
The number of columns (formed by the vertical grid lines) to draw within the frame. If there is no need of grid lines, set nVerGrid to 0 (zero) and VerGridCol to 0. nVerGrid cannot exceed the pixel height of the plot.
VerGridCol:
The color of the vertical grid lines (flashing color is not supported). Select a color from the list of Predefined Color Names and Codes or create an RGB-based color using the function MakeCitectColor.
FrameWidth:
The width (also called pen width) of the frame enclosing the grid, in pixels. To define the frame without drawing its boundaries, set FrameWidth to 0 (zero) and FrameCol to 0. The maximum is 32.
FrameCol:
The color of the frame enclosing the grid (flashing color is not supported). Select a color from the list of Predefined Color Names and Codes or create an RGB-based color using the function MakeCitectColor.
nFill:
The background color for the frame (flashing color is not supported). Select a color from the list of Predefined Color Names and Codes or create an RGB-based color using the function MakeCitectColor.
nMode:
The mode of the plot. For future use only - set it to 0 (zero).
Return Value
0 (zero) if successful, otherwise an error is returned.
Related Functions
PlotClose, PlotDraw, PlotInfo, PlotLine, PlotMarker, PlotOpen, PlotScaleMarker, PlotText, PlotXYLine, TrnPlot
Example
See PlotOpen
See Also