As you have so many columns, I would most likely build the Graph Builder expression instead of adding columns one by one. Create the graph manually, copy the script to see how it has been built and then replicate it using JSL. Below is one example
JMP created script
Graph Builder(
Size(528, 458),
Show Control Panel(0),
Variables(
X(:"0.642539"n, Combine("Parallel Merged")),
X(:"0.645736349"n, Position(1), Combine("Parallel Merged")),
X(:"0.648933698"n, Position(1), Combine("Parallel Merged")),
X(:"0.652131047"n, Position(1), Combine("Parallel Merged")),
X(:"0.655328396"n, Position(1), Combine("Parallel Merged")),
X(:"0.658525745"n, Position(1), Combine("Parallel Merged")),
X(:"0.661723094"n, Position(1), Combine("Parallel Merged")),
X(:"0.664920443"n, Position(1), Combine("Parallel Merged")),
X(:"0.668117792"n, Position(1), Combine("Parallel Merged")),
X(:"0.671315141"n, Position(1), Combine("Parallel Merged")),
X(:"0.67451249"n, Position(1), Combine("Parallel Merged")),
X(:"0.677709839"n, Position(1), Combine("Parallel Merged")),
X(:"0.680907188"n, Position(1), Combine("Parallel Merged")),
X(:"0.684104537"n, Position(1), Combine("Parallel Merged")),
X(:"0.687301886"n, Position(1), Combine("Parallel Merged")),
X(:"0.690499235"n, Position(1), Combine("Parallel Merged"))
),
Elements(Points(X(1), X(2), X(3), X(4), X(5), X(6), X(7), X(8), X(9), X(10), X(11), X(12), X(13), X(14), X(15), X(16), Legend(4)))
);
To create this with JSL you could do something like this
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Functional Data/NMR DoE.jmp");
nrmcols = dt << get column group("NMR Spectra");
colnames = Transform Each({col}, nrmcols,
AsColumn(dt, col) << get name;
);
colnames = colnames[1::20];
var_expr = Expr(Variables());
points_expr = Expr(Points());
For Each({colname, idx}, colnames,
x_expr = EvalExpr(X(Expr(NameExpr(AsColumn(dt, colname))), Position(1), Combine("Parallel Merged")));
point_expr = EvalExpr(X(Expr(idx)));
Insert Into(var_expr, Name Expr(x_expr));
Insert Into(points_expr, Name Expr(point_expr));
);
gb = Eval(Substitute(
Expr(dt << Graph Builder(
Size(528, 458),
Show Control Panel(0),
_var_,
Elements(_points_)
)),
Expr(_var_), Name Expr(var_expr),
Expr(_points_), Name Expr(points_expr)
));
Write();
-Jarmo