static LinePlot CreateWithGroup( DataObject dobj, String sXVarName, String sYVarName, Matrix mGroupVarNames <, boolean bShow> )
static LinePlot CreateWithGroup( String sDataName, Matrix mX, Matrix mY, Matrix mGroup <, boolean bShow> )
The return value is a reference to the newly created LinePlot object.
DataObject dobj
The DataObject containing the variables you want to plot.
String sXVarName
The name of the variable to assign to the X axis.
String sYVarName
The name of the variable to assign to the Y axis.
Matrix mGroupVarNames
A vector containing the names of the variables to use as group variables.
boolean bShow
If bShow is true, the plot's window is displayed. If bShow is false, the plot's window is hidden. Calling this method without specifying bShow is
equivalent to calling it with bShow equal to true.
String sDataName
The name to assign to the DataObject created internally by this method.
Matrix mX
A vector containing coordinate data for the X axis. This vector is used to create a DataObject and then that DataObject is used to create a LinePlot.
Matrix mY
A vector containing coordinate data for the Y axis. This vector is added to the same DataObject as the mX vector.
Matrix mGroup
A matrix that defines group variables. If mGroup is a vector, it defines a single group variable. If mGroup is not a vector, each column defines a group variable. The number
of observations in the group variables must equal the number of observations in the X and Y variables. This matrix is added to the same DataObject as the mX vector.
This method creates a line plot with one or more group variables. The set of unique observations in the group variables defines the groups and therefore the number of lines in the plot.
x = {1 2 3 4 5 1 2 4}; y = {1 2 3 4 5 2 3 1}; groups = { "A" "A" "A" "A" "A" "B" "B" "B" }; declare DataObject dobj; dobj = DataObject.Create( "Example" ); dobj.AddVar( "X", x ); dobj.AddVar( "Y", y ); dobj.AddVar( "Groups", groups ); LinePlot.CreateWithGroup( dobj, "X", "Y", "Groups" );