file:///D:/FH296/htmlgifs/AGIndex.gif file:///D:/FH296/htmlgifs/disPrevious.GIF file:///D:/FH296/htmlgifs/Next-3.gif

General Graph


Synopsis

Constructs from one to five 2D graphs from input X and Y data

Input Ports

User Interface Controls

 

Graph controls:

Axis controls:

World controls:

Viewport controls:

Legend controls:

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.

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 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.

Input Ports

valuesX

(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 corresponding Y data array.

valuesY1, valuesY2, valuesY3, valuesY4, valuesY5

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.

parent

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

Object

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 (the default): Display the Graph controls.

•      Axis: Display the Axis controls.

•      World: Display the World controls.

•      Viewport: Display the Viewport controls.

•      Legend: Display the Legend controls.

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.

Graph On/Off

A check box that specifies whether to display the current graph. The settings are:

•      Checked (the default): Display the graph.

•      Unchecked: Do not display the graph.

Graph priority

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.

Graphtype

A set of radio buttons with which to specify the type of the current graph. The choices are:

•      bars

•      barlines

•      area

•      curve

•      line (the default)

•      scatter

•      staircase

•      stairarea

Bar width

A text box in which to type the width of the bar.

This control is valid only when the current graph type is bars or barlines.

Line width

A text box in which to type the width of the line.

This control is valid only when the current graph type is curve or line.

Scatter symbol

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 (+).

This control is valid only when the current graph type is scatter.

Scatter size

A text box in which to type the point size of the scatter symbol. The default is 10.0 points.

This control is valid only when the current graph type is scatter.

Graph Name

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 controls.

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:

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:

•      solid (the default)

•      dashed

•      dotted

•      dashdotted

 

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:

XAxis, YAxis

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.

Axle on/off

A check box that specifies whether to display the current axis. The settings are:

•      Checked (the default): Display the axis.

•      Unchecked: Do not display the axis.

Y Axis crossing position
X Axis crossing position

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:

Current Axis

 

Control Value Meaning

 

Text Box Label

 

X axis

The point on the Y axis at which the X axis crosses

Y Axis crossing position

Y axis

The point on the X axis at which the Y axis crosses

X Axis crossing position

 

Axle width

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.

Axle color

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).

reverse text alignment

A check box that specifies where to display the label for the current axis. The settings are:

•      Checked: Display the label on the reverse (nonstandard) side.

•      Unchecked (the default): Display the label on the standard side.

Text height

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.

Text color

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).

X Axis Text
Y Axis Text

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).

The label for this text box varies depending on the current axis.

Label height

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.

Label color

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).

Label Decimals

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.

X Tickline on/off
Y Tickline on/off

A check box that specifies whether to display the tickline for the current axis. The settings are:

•      Checked (the default): Display the tickline.

•      Unchecked: Do not display the tickline.

The label for this text box varies depending on the current axis.

Steps for Major tick marks

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.

Steps for Minor tick marks

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.

Major tick style

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:

•      solid (the default)

•      dashed

•      dotted

•      dashdotted

Major tick color

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).

Minor tick style

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:

•      solid

•      dashed (the default)

•      dotted

•      dashdotted

Minor tick color

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:

clip toggle

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:

•      Checked: Clip the portion of the graph outside of the display area.

•      Unchecked (the default): Display the portion of the graph outside of the display area.

Y region min

A text box in which to type the minimum Y value to be displayed. The default is 0.00.

Y region max

A text box in which to type the maximum Y value to be displayed. The default is 0.00.

X region min

A text box in which to type the minimum Y value to be displayed. The default is 0.00.

X region max

A text box in which to type the maximum Y value to be displayed. The default is 0.00.

scale type X

A set of radio buttons with which to specify the scale type for the X coordinate space. The choices are:

•      linear

•      log10

•      power

scale type Y

A set of radio buttons with which to specify the scale type for the Y coordinate space. The choices are:

•      linear

•      log10

•      power

Viewport controls.

The Viewport controls, which set attribute values for the viewport defined for the current graph in the viewer window, include the following:

Frame visible

A check box that specifies whether to display a frame for the current graph's viewport. The settings are:

•      Checked (the default): Display a frame.

•      Unchecked: Do not display a frame.

Frame Width

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.

Frame Color

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).

Fill Color

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:

Legend On/Off

A check box that specifies whether to display a legend for the current graph. The settings are:

•      Checked (the default): Display a legend.

•      Unchecked: Do not display a legend.

Legend X position

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.

Legend Y position

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.

FillColor

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.

Frame Color

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).

Frame Width

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.

Label Height

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.

Number of Columns

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.

Label Color

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).

Title

A text box in which to type the title for the current graph's legend. The default is, simply, Title.

Title Height

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.

Title Color

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 Ports

out_obj

A renderable version of the resulting graphs.

File

v/aghlm.v

Example

mgraph.v

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.

mgraph2.v

This example uses field data to construct a graph. The array data is extracted from the field data using the extract_data_array module.

mgraph2.v

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.

See Also