See also the separate document on Tips & Tricks with GnuDraw.
Tables:
Closes the draw window. On many platforms nothing will happen, e.g. when the graphs appear in GiveWin, the graph will remain active there.
GnuDraw: Subsequent commands will use clean graphing window.
This function draws m variables against an X variable, where the X variable consists of evenly spaced observations x, x+dx, x+2dx, x+3dx, .... Each variable is drawn by linking up the points. The first line index is 2.
This function gives a line of information on the GnuDraw version on screen.
Alternatively, a vector of line indices can be passed along, see Tips.
Draws an ACF and/or PACF.
The expected number of arguments depends on the type of adjustment (use -1 to keep the default value):
In GnuDraw the options ADJ_AREA_3D, ADJ_AREASCOLOR, ADJ_AXISCENTRE,
ADJ_COLORMODEL, ADJ_PAPERCOLOR, ADJ_PAPERSCALE, ADJ_SCALE and
ADJ_SYMBOLUSE are not implemented at present.
New options are
ADJ_INDEX with first argument equal to 1 draws an index line, use 2 for bars. The second argument (not implemented in GnuDraw) sets the base for the index line or bars.
The type for ADJ_AXISSCALE is one of:
ADJ_LEGEND can be used to show a box around the legend; by default, GnuDraw does not display the box (but the default behaviour can be changed using SetDraw(SET_LEGEND, ...). Number of columns, fontsize and resizing are not implemented in GnuDraw.
For ADJ_SYMBOL, the default symbol size is 90; the symbol
types do not correspond fully to the symbol types in
ADJ_AREA_X, ADJ_AREA_Y, ADJ_AREA_Z have an optional argument
grow. Set this to one if the area should only grow if it already has
dimensions fixed.
With ADJ_AREA_X, the x_1 and x_2 can be
specified as dayofcalendar() values
for time series plots.
See Tips for a couple of advanced uses of DrawAdjust.
DrawAxis and DrawAxisAuto are partially implemented in GnuDraw, with ANCHOR_USER restricted to a choice of dAnchor= 0.
Draws the histogram and/or density of the data in the specified area. When fNormal is TRUE, a normal density with the same mean and variance as the data will be drawn. When weights are supplied, a weighted density plot is created.
For the last plot, the output [vX, vY, mZ] can be used as input for DrawXYZ. This way, it is possible to quickly draw a surface and a contour plot without reestimating the kernel approximation, i.e. using
See DrawAdjust(ADJ_CNTRPARAM, n) for adjusting the number of contour lines.
Draws a box plot of the data in the specified area. Note that subsequent plots in the same drawwindow might get disturbed slightly.
Draws a empirical cumulative distribution function of the data in the specified area, together with a box indicating the quantiles, and a cross at the location of the true parameters.
Draws a correlogram (the ACF is computed using acf, resulting in a slightly different plot from the oxdraw version of DrawCorrelogram).
Draws the histogram and/or density of the data in the specified area. When fNormal is TRUE, a normal density with the same mean and variance as the data will be drawn. When fCdf is TRUE, the CDF is plotted in a separate area. In case weights are supplied, a weighted density plot is created.
Draws a histogram when the data is already in histogram format, i.e. vBar contains the bar heights.
In GnuDraw, parameter iColorIn is not used due to limitations in GnuPlot.
Slight difference with oxdraw, as also fraction offset from top
left is allowed as input.
If both iOffsX and iOffsY are integer 0 or 1, GnuDraw
places the legend in the top-left (0, 0) or bottom-right (1, 1) corner.
Default is top-left.
Furthermore, the legend can be placed next to the graph, instead of in
the graphing area itself.
Alternatively, a vector of line indices can be passed along, see Tips.
This is a more flexible version of the Draw() function. DrawMatrix draws the m variables in the rows of mYt. The X variable consists of evenly spaced observations x, x+dx, x+2dx, x+3dx, .... The following table gives the default settings for each line index. Note that index 0 is the background colour, and 1 the foreground colour.
The coordinates (0, 0) indicate the lower left corner. The upper right corner is either (15.000, 10.000), or (1, 1). iFontNo and iFontSize are disregarded. With iJust, justification of the text can be chosen. Possible options are -1 (default, left), 0 (center) or 1 (right).
[Top]
Draws a QQ plot. The following distributions are supported:
Draws the estimated spectral density.
Draws m variables in the specified area against time. Each variable is drawn by linking up the points. The first line index is 2. Time can be specified as a combination of the year and period of the first observation together with the frequency, as a 2 x T matrix with months and years or as a 3 x T matrix with day, month and years.
See also DrawTMatrix for a more extensive function.
Note that the backward slash for LaTeX commands (if you use LaTeX output) must be doubled, for example:
Text can also be rotated, by specifying the angle in degrees. The fontsize can be used, but output depends on the terminal in use, e.g. results can be very different for screen, pdf or eps output.
The coordinate system can either be the standard coordinate system (iGraph=0), a graph coordinate system running from (0,0) to (1,1), (iGraph=1) or referring to the full screen (iGraph=2). It can be justified using iJust here, or by using a DrawAdjust(ADJ_LABEL, iGraph, iJust) command.
Alternatively, a vector of line indices can be passed along, see Tips.
This is a more flexible version of the DrawT() function. Draws m variables in the specified area against time. See under DrawMatrix for the default settings for each line index.
The x-area of the time series plot can be adapted using DrawAdjust, see the example among the Tips.
Draws m y variables in the specified area against an x variable. Each point is marked, but the points are not linked, resulting in a cross plot. The first line index is 2.
This is a more flexible version of the DrawX() function. Draws m variables in the specified area against an x variable. See under DrawMatrix for the default settings for each line index.
For compatibility with the OxDraw version of DrawXYZ, the first coordinate is plotted on the Y axis, the second on the X axis.
This routines plots Z data above a grid. See also DrawBivDensity and DrawAdjust(ADJ_CNTRPARAM, n).
DrawZ adds a Z component to the most recent graphics object. DrawZ should be a should be used immediately after a call to one of the draw functions Draw, DrawMatrix, DrawX, etc.).
The mode ZMODE_SYMBOL adapts symbol size. Default symbol size is 90.
Added is the functionality to plot asymmetric BAR, BAND and HILO plots (with mZ containing two rows, with either the `standard deviation' of the lower and higher part of the density, or (if dFac= 0) the lower and upper ranges. For these cases, the resulting lower and upper values are as indicated in the following table:
| dFac | z | Lower | Upper |
|---|---|---|---|
| > 0 | 1 x iT | vY - dF * mZ | vY + dF * mZ |
| > 0 | 2 x iT | vY - dF * mZ[0][] | vY + dF * mZ[1][] |
| = 0 | 2 x iT | mZ[0][] | mZ[1][] |
Asymmetric FAN plots are possible where the distance of the gridlines to the center can be specified completely. For a sensible fan plot, specify a larger (say 10-20) number of gridlines. As an example, the following two graphs would look the same:
The style of the labels is governed using a global setting with SetDraw(SET_LABDRAWZ, bStyle). By default (TRUE), a single label X x S is shown.
Saves the current graph to a file with extension .plt or .plb. GnuPlot uses this file as input to create a file with the specified extension. On Linux, Sun and Windows platforms, GnuPlot is called automatically, leaving both the .plt and the final output file at the specified location. The following formats are supported (with default values for x-size and y-size between parentheses):
If no filename is given, the graph is displayed on the screen, taking the output size into account (1, 1). By default, the graph is 640x480 points, a wider graph can be created using e.g.
The expected number of arguments depends on the type of adjustment:
For SET_FONT, an extra boolean enhanced can be set, indicating that fonts can use subscripts, superscripts etc. Default is TRUE.
SET_LABDRAWZ and SET_OUTPUT are specific to GnuDraw. The first controls the style of the labels for a DrawZ plot. If TRUE (default), a single label of the format X x S appears in the legend. If FALSE, two separate labels (e.g. X and S) are given in the legend.
The argument of SET_OUTPUT governs the type of screen output. Values are 0 (no output, corresponding to a call to DrawAdjust(ADJ_SHOW, FALSE)), 1 (default, either Windows or standard X11 output), or 2 (Linux only, wxt output).
Under Unix, this function continues graphing in a window with the name sTitle. All subsequent graphs, shown by the ShowDrawWindow command, appear within this window, instead of opening in new screens as in the default behaviour.
On non-Unix systems, this function for the moment does nothing.
See packages/gnudraw/samples/ar1.ox for an example.
This function is only relevant when interacting with GiveWin otherwise it does nothing. It sets the name of the GiveWin window in which the output (from the print() function) of the Ox program appears to sTitle.
Shows the drawing. Note that in some implementations the graphs cannot be displayed. Then a message is printed (SaveDrawWindow() will still work in that case!). ShowDrawWindow is implemented for the Windows, Linux and Sun environments.
A call to ShowDrawWindow also clears the drawing buffer, so that subsequent graphing starts from an empty sheet.
To control the size of the graph on the screen, use the commands SaveDrawWindow("", 10, 2, 1); which results in graph twice as wide as standard (under Windows, this only works if the user has writing rights in the windows directory).
GnuDraw version 5.0.
Original OxDraw ©
JA Doornik
Changes made on 9-February-2009 for including GnuDraw statements by
CS Bos