# MathTrace

A 2D math trace.

## Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])

-- Create a graph with a trace

-- Add a math trace that performs some calculation

mathTrace.Expression = string.format("%s * 1.5", farFieldTrace.Label)

graph:ZoomToExtents()


## Inheritance

The MathTrace object is derived from the ResultTrace object.

## Property List

Axes
The trace axes properties. (Read only TraceAxes)
AxisNames
The names of all the axes on the ResultPlot. (Read only List of string)
CommonRangeEnabled
Specifies whether the range is limited to the range common to all traces used in the expression. (Read/Write boolean)
DataSource
The source of the trace. (Read/Write ResultData)
Expression
The math expression used to calculate this trace, e.g. “ramp(0,1,100)”. (Read/Write string)
IndependentAxesAvailable
The list of available independent axes. (Read only List of string)
IndependentAxis
The independent axis of the plot to be displayed, e.g., Frequency, X, Y, Z, etc. (Read/Write string)
Label
Legend
The trace legend properties. (Read only TraceLegendFormat)
Line
The trace line format properties. (Read only TraceLineFormat)
Markers
The trace marker format properties. (Read only TraceMarkersFormat)
Sampling
The continuous trace sampling settings. These settings only apply to traces when the independent axis is continuously sampled. (Read only TraceSamplingFormat)
Type
The object type string. (Read only string)
Values
The values that are plotted on the graph for this trace. The first column represents the independent axis and the second column represents the scalar quantity being displayed on the graph. Each row represents a sampled coordinate pair. (Read only Matrix)
Visible
Specifies whether the trace must be shown or hidden. (Read/Write boolean)

## Method List

Delete ()
Delete the trace.
Duplicate ()
Duplicate the trace. (Returns a ResultTrace object.)
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step. (Returns a table object.)
Lower ()
Lower the trace.
Raise ()
Raise the trace.
SetProperties (properties table)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.

## Property Details

Axes
The trace axes properties.
Type
TraceAxes
Access
AxisNames
The names of all the axes on the ResultPlot.
Access
CommonRangeEnabled
Specifies whether the range is limited to the range common to all traces used in the expression.
Type
boolean
Access
DataSource
The source of the trace.
Type
ResultData
Access
Expression
The math expression used to calculate this trace, e.g. “ramp(0,1,100)”.
Type
string
Access
IndependentAxesAvailable
The list of available independent axes.
Access
IndependentAxis
The independent axis of the plot to be displayed, e.g., Frequency, X, Y, Z, etc.
Type
string
Access
Label
The object label.
Type
string
Access
Legend
The trace legend properties.
Type
TraceLegendFormat
Access
Line
The trace line format properties.
Type
TraceLineFormat
Access
Markers
The trace marker format properties.
Type
TraceMarkersFormat
Access
Sampling
The continuous trace sampling settings. These settings only apply to traces when the independent axis is continuously sampled.
Type
TraceSamplingFormat
Access
Type
The object type string.
Type
string
Access
Values
The values that are plotted on the graph for this trace. The first column represents the independent axis and the second column represents the scalar quantity being displayed on the graph. Each row represents a sampled coordinate pair.
Type
Matrix
Access
Visible
Specifies whether the trace must be shown or hidden.
Type
boolean
Access

## Method Details

Delete ()
Delete the trace.
Duplicate ()
Duplicate the trace.
Return
ResultTrace
The duplicated trace.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step.
Return
table
A properties table.
Lower ()
Lower the trace.
Raise ()
Raise the trace.
SetProperties (properties table)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
Input Parameters
properties(table)
A table of properties defining the new state of the object.