Plotting

There are two available methods for plotting data from within RLaB . Probably the most desirable is the usage of the builtin plotting library, Plplot. The second method involves the usage of RLaB 's I/O abilities (piping) to send data and commands to another running process - Gnuplot, for example. A fairly extensive example of this second method is provided in the RLaB source distribution in the file misc/gnu_plot.r. We shall focus on the builtin plotting capability.

There are two new terms you must learn to understand plotting - plot-window, and sub-plot. The plot window is manifested on the plot-device, such as a Tektronix screen, X-window display, or a printer. RLaB will allow you to have multiple plot-windows, if your display device will support it. X-windows supports multiple plot-windows, but a Tektronix display, or DOS display will not.

The next term is sub-plot. Each plot-window can have 1 or more sub-plots. The layout of the sub-plots is determined when pstart is called.

Regardless of the number of plot-windows and sub-plots, there can only be one current plot-window, and one current sub-plot within the current plot-window. Each plot related function will only work on the current sub-plot in the current plot-window. This way the majority of the plot functions are the same, regardless of the output device. The current sub-plot is always the next plot. As soon as a plot function is used that actually draws the plot on the plot-device, such as plot, plot3 or plhist, the current sub-plot is incremented. Therefore, all functions that effect the appearance of a plot must be used before the plot is drawn.



Subsections