Hey guys I'm pretty new to JMP and JSL, but am pretty familiar with coding. I'm trying to create a JSL script that will take a list of parameters names (that I define in the "PlotVars" array) and then plot them all in separate plots on the same graph. I want this script to work regardless of how many parameters are defined in this array (in case I want to add or subtract parameters for each use). I can get my script to produce this (using the code below), but all of the plots default to using points, and I would like them to use a line instead. My understanding of how to do this is to use multiple element statements for each position. I believe the problem lies with my second line where I initialize the "var_line" variable. If I initialize it as Expr() then it will produce the element statements but won't run them properly. Same thing if I initialize them as Parse(). Open to any ideas to solve this though. I'm using JMP 18.
Edit (jthi): Added jsl formatting
var_expr = Expr(
Variables(X(As Column("Start Alignment of " || DataSet_1)))
);
var_line = Expr();//Unable to dymanically add elements to the graph. still unsure why
For(i = 1, i <= N Items(PlotVars), i++,
Insert Into(var_expr, Eval Expr(Y(As Column(PlotVars[Expr(i)] || " of " || DataSet_1), )));
Insert Into(
var_expr,
Eval Expr(Y(As Column(PlotVars[Expr(i)] || " of " || DataSet_2), Position(Expr(i)), ))
);
Insert Into(
var_line,
Eval Expr(Elements(Position(1, Expr(i)), Line(X, Y(1), Y(2)), Legend(4)))
);
);
plot = Substitute(
Expr(
Data Table("Comparison of" || DataSet_1 || "with" || DataSet_2) <<
Graph Builder(Size(809, 629), Show Control Panel(0), vvv, yyy)
),
Expr(vvv), Name Expr(var_expr),
Expr(yyy), Name Expr(test)
);
Eval(plot);
<
var_expr = Expr(Variables(X( as column("Start Alignment of " || DataSet_1) )));
var_line = Expr();//Unable to dymanically add elements to the graph. still unsure why
for(i=1, i<=N Items(PlotVars),i++,
Insert Into(var_expr, Eval Expr(Y( as column(PlotVars[expr(i)] || " of " || DataSet_1),)));
Insert Into(var_expr, Eval Expr(Y( as column(PlotVars[expr(i)] || " of " || DataSet_2), Position(expr(i)),)));
Insert Into(var_line, Eval Expr(Elements(Position(1,expr(i)),Line(X,Y(1),Y(2)),Legend(4))));
);
plot = Substitute(
Expr(
Data Table( "Comparison of" || DataSet_1 || "with" ||DataSet_2 ) <<
Graph Builder(
Size( 809, 629 ),
Show Control Panel( 0 ),
vvv,
yyy
)),
Expr(vvv), Name Expr(var_expr),
Expr(yyy), Name Expr(test)
);
Eval(plot);
>