Line turns to smoother when created from JSL script.Can anyone help me identify what am I doing wrong here
Graph Builder(
Size(984, 563),
Show Control Panel(1),
Variables(X(:X), Y(As Column(Y))),
Elements(Line(X, Y, Legend(3), Connection("Curve")), Points(X, Y, Legend(4)))
)
My line turns to a smoother , I want it to touch all the points with a curve connection . I created the chart from console of JMP and it worked fine , I even copied the JSL from the session script but turns out whenever I run it through JSL it gives me a smoother .
I have one more question - The smoother gets drawn on continuous Numeric column . I though maybe changing it to nominal might have some impact and it did not get created at all(no line nor the smoother) . Does line not work on nominal type Numeric column ?
Automation and ScriptingBasic Data Analysis and ModelingData Exploration and VisualizationRe: Line turns to smoother when created from JSL script.You are using Curve connection and not Line so that gives you smoothing. Also it might not be able to connect all the points if there are many values for same X-axis values unless you enable Row order.
Without row order

With row order (I did sort the data by weight first)

Re: Line turns to smoother when created from JSL script.
This is what I achieve when using code - .


But when manually I add a line

Next - I change the connection to curve



I achieve what I desire . A curve touching all of my points .
So how can I achieve this via my code?
Re: Line turns to smoother when created from JSL script.Smoother (with points) is the default for some column selections, that could be the reason why JMP is using it for your graph. How does JMP created script look like if you get it from the smoother version?
For me this seems work ok.
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(7),
Compress File When Saved(1),
New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4, 5, 6, 7])),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([100, 89, 60, 50, 40, 20, 10]))
);
gb = dt << Graph Builder(
Size(528, 454),
Show Control Panel(0),
Variables(X(:Column 1), Y(:Column 2)),
Elements(Points(X, Y, Legend(3)), Line(X, Y, Legend(6), Connection("Curve")))
);

Re: Line turns to smoother when created from JSL script.This doesn't work for me .
I tried it again .
I did not create a smoother manually . I created Line and added points to it and changed it to curve. Copied the script (same as the one in description) . But the same script is creating smoother not Line.
Q- When you run your script, what do you see on the control panel on the left side Points and Line? or Points and Smoother? For me , I see points and smoother on running my Line script.
Can you try adding more points to your code little in zigzag form and then run your script ?
Re: Line turns to smoother when created from JSL script.Which JMP version are you running? I'm running 18.1.2. Did you try running my script? Can you provide your data table?
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(10),
Compress File When Saved(1),
New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([100, 80, 90, 60, 70, 40, 30, 35, 20, 10]))
);
gb = dt << Graph Builder(
Variables(X(:Column 1), Y(:Column 2)),
Elements(Points(X, Y, Legend(3)), Line(X, Y, Legend(6), Connection("Curve")))
);

Re: Line turns to smoother when created from JSL script.My JMP version is

I have renamed the columns , and also deleted the other columns except my X and Y . Check if this works for you .
Re: Line turns to smoother when created from JSL script.Seems fine?

Names Default To Here(1);
dt = Open("$DOWNLOADS/data_jmp.jmp");
gb = dt << Graph Builder(
Variables(X(:X), Y(:Y)),
Elements(Line(X, Y, Legend(5), Connection("Curve")), Points(X, Y, Legend(6)))
);Re: Line turns to smoother when created from JSL script.Yeah same is working for me individually , why is it not working from a loop
. What is wrong . Can you check this script once -
createDashboard = Function({dtMaxF, dtMaxR, normMeanColsF, normMeanColsR, direction},
New Window(direction || " Dashboard",
Tab Box(
"Maximum Values",
V List Box(
For(i = 1, i <= N Items(normalizedColumns), i++,
Graph Builder(
Size(984, 563),
Show Control Panel(1),
Variables(X(:X), Y(As Column(normalizedColumns[i]))),
Elements(
Line(X, Y, Legend(5), Connection("Curve")),
Points(X, Y, Legend(6))
)
)
)
),
"Normalized Average Values",
V List Box(
For(i = 1, i <= N Items(normMeanColsF), i++,
Graph Builder(
Size(984, 563),
Show Control Panel(1),
Variables(X(:X), Y(As Column(normMeanColsF[i]))),
Elements(
Line(X, Y, Legend(5), Connection("Curve")),
Points(X, Y, Legend(6))
)
)
),
For(i = 1, i <= N Items(normMeanColsR), i++,
Graph Builder(
Size(984, 563),
Show Control Panel(1),
Variables(X(:X), Y(As Column(normMeanColsR[i]))),
Elements(
Line(X, Y, Legend(5), Connection("Curve")),
Points(X, Y, Legend(6))
)
)
)
)
)
)
);
createDashboard(
dtMaxForward, dtMaxReverse, normalizedMeanColumns, normalizedMeanColumns, "Analysis"
);Re: Line turns to smoother when created from JSL script.What at dtMaxF, dtMaxR used for in the function? Where is normalizedColumns coming from to the function?
Re: Line turns to smoother when created from JSL script.ignore dtMaxF, dtMaxR (i will remove this from code ) . I am attaching the complete script for you to analyze
Re: Line turns to smoother when created from JSL script.Start with something very small. You can start by scripting single graph if your table creations are working properly. Then expand to few different graphs possibly from different tables. You are missing table references when plotting and your formulas might not behave as you expect (Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute ) .
Re: Line turns to smoother when created from JSL script.Okay let me try that . Umm so far all formulas are working , but let me check it again