General Graph
Synopsis
Constructs from one to five 2D graphs from input X and Y data
Input Ports
User Interface Controls
Y Axis crossing position UIfield
X Axis crossing position UIfield
reverse text alignment UItoggle
Label height UIslider, UIfield
Steps for Major tick marks UIfield
Steps for Minor tick marks UIfield
Label Height UIslider, UIfield
Title Height UIslider, UIfield
Output Ports
Description
The General Graph macro combines the Graph, XYAxis, GraphWorld, GraphViewport, and GraphLegend modules to provide a powerful graph creation and display tool. This macro constructs up to five graphs from a single set of X data and up to five sets of Y data, and displays the resulting graphs simultaneously.
The X data, which is optional, is input to port 1 as the array valuesX[]. If you do not input X data, General Graph plots the Y data against equal intervals on the X axis, with the size and number of intervals for a graph based on the range of values in the corresponding Y data array.
The Y data is input as the arrays valuesY1[] through valuesY n [] (1<= n <=5). The arrays are input to ports 2 through 6; however, it does not matter which or how many ports are used, because General Graph reads in the Y data arrays in port order and names them accordingly. For example, if Y data is input only to ports 3 and 5, the data at port 3 is the array valuesY1 and the data at port 5 is the array valuesY2.
General Graph assigns to each of the resulting graphs a name that corresponds to the Y data array used: Graph1 uses the valuesY1[] array, Graph2 uses the valuesY2[] array, and so forth.
When you execute General Graph, the user interface opens. At the top of the interface is an Object option menu from which you select the set of user interface controls displayed in the remainder of the interface. The following control sets are available:
The Graph controls (the default selection) include:
The current graph; that is, the graph for which attributes are to be set.
General attributes for the current graph; for example, its type and color.
This user interface has the same controls as the Graph module, plus extra controls specific to General Graph.
The Axis controls include the attributes of each axis in the current graph. It has the same controls as the XYAxis module.
The World controls include the attributes of the World coordinate space created inside the viewport for the current graph. It has the same controls as the GraphWorld module.
The Viewport controls include the attributes of the graph viewport defined in the viewer window for the current graph. It has the same controls as the GraphViewport module.
The Legend controls include the attributes of the legend displayed for the current graph. It has the same controls as the GraphViewport module.
Input Ports
(Optional) An array of data, input to port 1, to be used as the X values when constructing graphs. If you do not input X data, General Graph plots the Y data against equal intervals on the X axis, with the size and number of intervals for a graph based on the range of values in the
From one to five arrays of data to be used as the Y values when constructing the graphs. Each array is input to a port from 2 through 6; however, it does not matter which or how many ports are used, because General Graph reads in the Y-data arrays in port order and names them accordingly. For example, if Y data is input only to ports 3 and 5, the data at port 3 is valuesY1 and the data at port 5 is valuesY2, with the corresponding graphs having the names Graph1 and Graph2.
Connects the module to a user interface object that contains the module's user interface objects. By default, this input port is connected to the default user interface object in the application in which the module is instanced.
User Interface Controls
An option menu from which to select the user interface controls to be displayed in the lower part of the General Graph user interface. The options are:
Graph controls.
The Graph controls, which specify the current graph (the graph whose attributes are to be set) and set attribute values for that graph, include the following:
Graph1, Graph2, Graph3, Graph4, Graph5
A set of radio buttons with which to specify the current graph : the graph whose attribute values you want to set (the default is Graph1). Which controls are displayed vary depending on the graph type selected. For example, if Graph2 is a bar graph and Graph3 is a scatter graph, the user interface displays only the Graph controls appropriate to a bar graph when you select Graph2 but only those appropriate to a scatter graph when you select Graph3.
A text box in which to type an integer value that specifies the current graph's priority. The graph priority determines the order in which General Graph draws the graphs: a graph with a higher priority value is drawn later that a graph with a lower priority value. The default is 1.
A text box in which to type the symbol or text input positioned at data points in a scatter graph. The default is the plus sign (+).
A text box in which to type the name to be used in the legend for the current graph. The default is, simply, Graph. The specified name is reflected in the Legend control set See Legend
The legend reflects the value set for the Graph Name control in the Graph control set. The Legend controls, which set attribute values for the legend displayed for the current graph, include the following: line style
An option menu from which to select the style of lines in the current graph. You can specify the value of this attribute as an array that describes the shape of the line, or you can choose it from the menu. The options are:
An option menu from which to select the color of lines in the current graph. The options include standard color names such as red (the default), yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background or antibackground.
Axis Controls
The Axis controls, which set attribute values for the current graph's X and Y axes, include the following:
A set of radio buttons with which to specify the current axis : the axis in the current graph whose attribute values you want to set. Which controls are displayed vary depending on the axis selected. The default is YAxis.
A text box in which to specify where the current axis crosses the other axis. The exact meaning of the contents of this text box, as well as its label, vary depending on the current axis, as follows:
A slider/text box combination with which to specify the width in points of the current axle. You can either move the slider to the desired value or type in the value. The default is 1.00 points.
An option menu from which to select the color of the current axle. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background or antibackground (the default).
A slider/text box combination with which to specify the height in points of the label text for the current axis. You can either move the slider to the desired value or type in the value. The default is 5.00 points.
An option menu from which to select the color of the label text for the current axis. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined reference color settings such as background or antibackground (the default).
A text box in which to type the label text for the current axis. The default is, simply, X axis text or Y axis text (as appropriate).
A slider/text box combination with which to specify the height in points of the label for the current axis. You can either move the slider to the desired value or type in the value. The default is 5.00 points.
An option menu from which to select the color of the label for the current axis. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined reference color settings such as background or antibackground (the default).
A slider with which to specify the number of places after the decimal point in the label for the current axis. The default is 0.
The number of decimal places actually used will be less than or equal to the value that you specify with this control.
A text box in which to type an integer value that specifies the number of major tick marks to use along the current axis. By default, this control is unset.
A text box in which to type an integer value that specifies the number of minor tick marks to use between major tick marks along the current axis. The default value is 2.
An option menu from which to select the style of major tick marks on the current axis. You can specify the value of this attribute as an array that describes the shape of the tick mark, or you can choose it from the menu. The options are:
An option menu from which to select the color of major tick marks on the current axis. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background or antibackground (the default).
An option menu from which to select the style of minor tick marks on the current axis. You can specify the value of this attribute as an array that describes the shape of the tick mark, or you can choose it from the menu. The options are:
An option menu from which to select the color of minor tick marks on the current axis. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background or antibackground (the default).
World controls.
The World controls, which set attribute values for the World coordinate space created inside the viewport for the current graph, include the following:
UItoggle. Determines whether the portion of the graph outside the display area should be drawn or clipped.
A check box that specifies whether to clip the portion of the graph outside of the display area. The settings are:
A set of radio buttons with which to specify the scale type for the X coordinate space. The choices are:
A set of radio buttons with which to specify the scale type for the Y coordinate space. The choices are:
Viewport controls.
The Viewport controls, which set attribute values for the viewport defined for the current graph in the viewer window, include the following:
A check box that specifies whether to display a frame for the current graph's viewport. The settings are:
A slider/text box combination with which to specify the width in points of the line used to draw the frame for the current graph's viewport. You can either move the slider to the desired value or type in the value. The default is 0.01 points.
An option menu from which to select the color of the frame for the current graph's viewport. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background or antibackground (the default).
An option menu from which to select the background color for the current graph's viewport. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background (the default) or antibackground.
Legend controls.
The legend reflects the value set for the Graph Name control in the Graph control set ( See Graph Name ). The Legend controls, which set attribute values for the legend displayed for the current graph, include the following:
A text box in which to type the X coordinate of the upper left corner of the current graph's legend. The default value is 5.50.
A text box in which to type the Y coordinate of the upper (left? right?) corner of the current graph's legend. The default value is -3.00.
An option menu from which to select the background color for the current graph's legend. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background (the default) or antibackground.
An option menu from which to select the color of the frame for the current graph's legend. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined color settings such as background or antibackground (the default).
A slider/text box combination with which to specify the width in points of the line used to draw the frame for the current graph's legend. You can either move the slider to the desired value or type in the value. The default is 0.10 points.
A slider/text box combination with which to specify the height in points of the label for the current graph's legend. You can either move the slider to the desired value or type in the value. The default is 2.00 points.
A text box in which to type the number of columns in the current graph's legend. In the case of multiple graph inputs, specify 1 (the default) to arrange all of the legends in a vertical line.
An option menu from which to select the color of the label for the current graph's legend. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined reference color settings such as background or antibackground (the default).
A text box in which to type the title for the current graph's legend. The default is, simply, Title.
A slider/text box combination with which to specify the height in points of the title for the current graph's legend. You can either move the slider to the desired value or type in the value. The default is 4.00 points.
An option menu from which to select the color of the title for the current graph's legend. The options include standard color names such as red, yellow, magenta, cyan, black, white, or gray, or predefined reference color settings such as background or antibackground (the default).
Output Port
Example
This example uses the data from floating-point arrays to construct two graphs. The X data is input to port 1 (the leftmost port) and the Y data is input to ports 2 and 3.
This example uses field data to construct a graph. The array data is extracted from the field data using the extract_data_array module.
This example uses data from a column-data file to construct a graph. A file in table format is read in using the Read_Column_File module. The extract column module then extracts from the column the data used to construct the graph.
File
See Also Related Modules