LineGraph

DESCRIPTION

This module produces a line graph (or plot) from a 1-dimensional (y as a function of x) dataset. It accepts multiple inputs, plots each curve on the same set of axes, and allows the styles of each curve (line color, line style, etc) to be independently edited. If the module is saved as part of a map, these styles are saved as well.

INPUTS

Port: Input Values
Type: Lattice
Constraints: 1-D
Constraints: -vector
Constraints: byte..double
Input lattice. If this contains more than one set of data, then each set is plotted as a separate curve. In addition, this port supports fan-in - i.e., more than one lattice can be connected, and each set of data from each lattice will be plotted.

WIDGETS

Port: LogX
Type: Radio Box
Menu Item: Linear
Menu Item: Log
Controls whether the X axis is linear or logarithmic. If a logarithmic axis is selected and any of the X values to be plotted are negative, a warning will be issued, and the axis will revert to linear.

Port: GridX
Type: Radio Box
Menu Item: No grid
Menu Item: Grid
Controls whether grid lines are drawn normal to the X axis.

Port: LogY
Type: Radio Box
Menu Item: Linear
Menu Item: Log
Controls whether the Y axis is linear or logarithmic. If a logarithmic axis is selected and any of the Y values to be plotted are negative, a warning will be issued, and the axis will revert to linear.

Port: GridY
Type: Radio Box
Menu Item: No grid
Menu Item: Grid
Controls whether grid lines are drawn normal to the Y axis.

Port: X Axis Label
Type: Text
Label for the X axis.

Port: Y Axis Label
Type: Text
Label for the Y axis.

Port: X Axis Label Scale
Type: Dial
Scaling parameter for the X axis annotation.

Port: Y Axis Label Scale
Type: Dial
Scaling parameter for the Y axis annotation.

Port: Plot Title
Type: Text
Title for the plot. This is placed centrally on the plot. If a legend is selected, the title will be shifted so that it is still central to the plotting space.

Port: Legend Title
Type: Text
Title for the legend. No legend will be drawn unless a value for this is given.

Port: Select Data
Type: Option Menu
Menu Item: Data 1
Menu Item: Data 2
Menu Item: Data 3
Menu Item: Data 4
Menu Item: Data 5
Menu Item: Data 6
Allows each of the datasets (each of which is plotted as a curve) to be selected. Selecting a dataset causes the widgets which control its plotting style (see below) to be exposed on the module control panel.

Each dataset is given a default label (Data 1, Data 2...) which is used on this widget. The label may be changed by setting the value of the appropriate Label parameter (see below).

Port: Color 1, Color 2, ...
Type: Option Menu
Menu Item: Red
Menu Item: Green
Menu Item: Blue
Menu Item: Yellow
Menu Item: Cyan
Menu Item: Magenta
Menu Item: White
Allows the color of each curve (1, 2 ...) to be set. Only one of these widgets - that attached to the currently selected dataset (see above) - is exposed at any time.

Port: Style 1, Style 2, ...
Type: Option Menu
Menu Item: Solid Line
Menu Item: Dashed Line
Menu Item: Dotted Line
Menu Item: Stairs
Menu Item: Smooth Curve
Menu Item: Points
Menu Item: Points and Line
Menu Item: Points and Curve
Menu Item: Filled Line
Menu Item: Filled Curve
Allows the style of each curve (1, 2 ...) to be set. Only one of these widgets - that attached to the currently selected dataset (see above) - is exposed at any time.

Port: Label 1, Label 2, ...
Type: Text
Label for each dataset. For any dataset, if a value is entered here, it is used in the plot's Legend, and also in the Select Data widget (see above) to refer to this dataset.

Port: Calculate X Min
Type: Check Box
Determines whether or not the minimum X extent of the plot is calculated from the data.

Port: X Min
Type: Slider
Value for the minimum X extent of the plot. Data values outside this limit are not plotted.

This widget is disabled if X Min is being calculated from the data (see above). Its value, however, is still consistent with the minimum X value in the data.

In addition, the limits on this widget are updated whenever any new data is passed to this module.

Port: Calculate X Max
Type: Check Box
Determines whether or not the maximum X extent of the plot is calculated from the data.

Port: X Max
Type: Slider
Value for the maximum X extent of the plot. Data values outside this limit are not plotted.

This widget is disabled if X Max is being calculated from the data (see above). Its value, however, is still consistent with the maximum X value in the data.

In addition, the limits on this widget are updated whenever any new data is passed to this module.

Port: Calculate Y Min
Type: Check Box
Determines whether or not the minimum Y extent of the plot is calculated from the data.

Port: Y Min
Type: Slider
Value for the minimum Y extent of the plot. Data values outside this limit are not plotted.

This widget is disabled if Y Min is being calculated from the data (see above). Its value, however, is still consistent with the minimum Y value in the data.

In addition, the limits on this widget are updated whenever any new data is passed to this module.

Port: Calculate Y Max
Type: Check Box
Determines whether or not the maximum Y extent of the plot is calculated from the data.

Port: Y Max
Type: Slider
Value for the maximum Y extent of the plot. Data values outside this limit are not plotted.

This widget is disabled if Y Max is being calculated from the data (see above). Its value, however, is still consistent with the maximum Y value in the data.

In addition, the limits on this widget are updated whenever any new data is passed to this module.

OUTPUTS

Port: Graph
Type: Geometry
Output plot.

PROBLEMS

This module is currently limited to plotting a finite number of curves. The limit has been set at six, partly in order to make the control panel (and input and output port menus) manageable, but there is no reason why this limit could not be raised by adding more ports, changing the appropriate constant in the source of the module (see below) and rebuilding it.

SEE ALSO

ReadECF

The source for this module is in %EXPLORERHOME%\src\LineGraph on NT and $EXPLORERHOME/src/LineGraph on UNIX; it can act as a starting point for the development of modules for producing customised plots.


[ Documentation Home ]

© The Numerical Algorithms Group Ltd, Oxford UK. 1999