JSL coding debug - help needed with "Label"Hello,
In my JSL code, I am using
dtt<
and I can see in the table that label icon is being added next to skew. Then I am using graph builder and within that routine, I have
Show labels(1),
But when plots are being generated, it is not showing Label. Can you please help on this? Do I need to add anything else?
Thanks much
Automation and ScriptingRe: JSL coding debug - help needed with "Label"Usually you enable labels from Label section on the left (this can be different for different plot types)

After you are happy with your graph builder, copy the script
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
dt << Set Label Columns(:City, :State);
gb = dt << Graph Builder(
Size(528, 454),
Show Control Panel(0),
Variables(X(:Longitude), Y(:Latitude)),
Elements(Points(X, Y, Legend(3), Label("Label by Row")))
);Re: JSL coding debug - help needed with "Label" you have to activate the labels in the control panel:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:name<< Label( 1 ); // no effect, label is already activated by default for this column
Graph Builder(
Size( 451, 447 ),
Graph Spacing( 4 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Label( "Label by Row" ) ), Smoother( X, Y ) )
);

Re: JSL coding debug - help needed with "Label"-
Re: JSL coding debug - help needed with "Label"Thank you for the tips but unfortunately still Not working. I highlighted in bold the lines in my JSL.
dtt<
Summarize(dtt, byGroup0 = by (:layout));
Summarize( dtt, byGroup1 = by( :Label ));
Summarize( dtt, byGroup2 = by( :Vt_flavor));
Summarize( dtt, byGroup3 = by( :Z_width));
For (nn =1, nn <= N Items (byGroup0), nn++,
For ( ii = 1, ii <= N Items( byGroup1 ), ii++,
For ( jj = 1, jj <= N Items( byGroup2 ), jj++,
For ( kk = 1, kk <= N Items( byGroup3 ), kk++,
dtt << select where(:Label == byGroup1[ii] & :Vt_flavor == byGroup2[jj] & :Z_width == byGroup3[kk] & :layout ==byGroup0[nn] );
//show(ii,jj,kk,bygroup1[ii],bygroup2[jj],bygroup3[kk]);
sel = dtt << get selected rows;
If( n rows(sel) > 0,
//show("inside",ii,jj,kk);
dt = dtt << subset( selected rows(1), selected columns(0));
gb = dt << Graph Builder(
Size( 266, 228 ),
Show Control Panel( 0 ),
Variables( X( :nmos ), Y( :pmos ), Overlay( :PDK ) ),
Elements( Points( X, Y, legend( 5 ), Label("Label by Row") ) ),
Show labels(1),
SendToReport(
Dispatch(
{},
"nmos",
ScaleBox,
{Label Row(
{Show Major Grid( 1 ), Show Minor Labels( 1 ), Show Minor Grid( 1 )}
)}
),
Re: JSL coding debug - help needed with "Label"could you please generate a code - as short as possible.
Starting with loading a data table , e.g.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
and post it via:

Getting fast helpful answers to your questions
Getting correct answers to correct questions quickly
Re: JSL coding debug - help needed with "Label"My sincere apology for dumb questions. Not sure what you meant by "Activate the label". I am just running JSL on my database and not clicking on any GUI to activate anything. I thought that setting the column "skew" as label and then what you suggested to add "Label by row" - it should work? Can you please elaborate on the activation part in JSL script (not clicking on any GUI)? Thanks
Re: JSL coding debug - help needed with "Label"Also I am generating hundreds of plot, so activating by clicks will not work for my purpose. Thanks
Re: JSL coding debug - help needed with "Label"please share your code and we can check ...
The smart/lazy way to use JMP:
use the GUI and let JMP generate the code.
Re: JSL coding debug - help needed with "Label"Attached are the JSL code and associated data table. Also the graph size is always coming to be Size( 1401, 909 ) even though my code has it as Size (266,228). Appreciate if you can also take a look on that. Thank you so much for your time and help.
Re: JSL coding debug - help needed with "Label"Using GUI to create the script means, that do it once, copy the script and use that JMP generated JSL going forward. When JMP is able to create those scripts properly (like running platforms) it is the best JSL scripter you have.
On your issue: solve the issues for single graph first (so drop the loops and use one subset). After you get that working as intended, then add the loops as it makes it much easier to debug. When I run your plot for one I get this

My guess is that your problems are within the graphic script. I'm not exactly sure what you are trying to do within it?
Re: JSL coding debug - help needed with "Label"Did you use the code as-is or you changed something?
Re: JSL coding debug - help needed with "Label"Names Default To Here(1);
dtt = Open("$DOWNLOADS/output_sorted_test.jmp");
dtt << Set Label Columns(:skew);
Summarize(dtt, byGroup0 = by(:layout));
Summarize(dtt, byGroup1 = by(:Label));
Summarize(dtt, byGroup2 = by(:Vt_flavor));
Summarize(dtt, byGroup3 = by(:Z_width));
nn = 1;
ii = 1;
jj = 1;
kk = 1;
dtt << select where(:Label == byGroup1[ii] & :Vt_flavor == byGroup2[jj] & :Z_width == byGroup3[kk] & :layout == byGroup0[nn]);
sel = dtt << get selected rows;
If(N Rows(sel) > 0,
dt = dtt << subset(selected rows(1), selected columns(0));
gb = dt << Graph Builder(
Size(266, 228),
Show Control Panel(0),
Variables(X(:nmos), Y(:pmos), Overlay(:PDK)),
Elements(Points(X, Y, legend(5), Label("Label by Row"))),
Show labels(1),
SendToReport(
Dispatch({}, "nmos", ScaleBox, {Label Row({Show Major Grid(1), Show Minor Labels(1), Show Minor Grid(1)})}),
Dispatch({}, "pmos", ScaleBox, {Label Row({Show Major Grid(1), Show Minor Labels(1), Show Minor Grid(1)})}),
Dispatch({}, "Graph Builder", FrameBox,
{Marker Size(6), Add Graphics Script(
6,
Description(""),
Summarize(dt, byGroup = by(:PDK));
colorList = {"Blue", "red", "Green", "Green"};
Fill Pattern([0]);
For(i = 1, i <= N Items(byGroup), i++,
Pen Color(colorList[i]);
theRows = dt << get rows where(
:PDK == byGroup[i] & :skew != "tttt" & :skew != "ff" & :skew != "fs" & :skew != "sf" & :skew != "ss"
);
If(Word(2, byGroup[i], "/") == "a",
Line Style("Dashed"),
);
theRows = theRows |/ theRows[1];
xMatrix = :nmos[theRows];
yMatrix = :pmos[theRows];
Line(xMatrix, yMatrix);
);
), Add Text Annotation(
Text(byGroup1[ii] || "_" || "Z" || byGroup3[kk] || "_" || bygroup2[jj] || "_" || bygroup0[nn]),
Background Color("White"),
Filled(0),
Font("Segoe UI", 14, "Plain")
)}
)
)
);
);
Write();Re: JSL coding debug - help needed with "Label"This is very strange. I tried with one plot. Somehow it does not show the label. I also tried copying your code and ran - it does not show the label. Below is what I get from a single plot and as you can see somehow the Label by row does not show up (as expected). I added in back, re-ran the script, it is same - no label.
Graph Builder(
Size( 1430, 909 ),
Show Control Panel( 0 ),
Variables( X( :nmos ), Y( :pmos ), Overlay( :PDK ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch( {}, "nmos", ScaleBox,
{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 ), Show Minor Labels( 1 )} )}
),
Dispatch( {}, "pmos", ScaleBox,
{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 ), Show Minor Labels( 1 )} )}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Marker Size( 6 ), Marker Drawing Mode( "Normal" ),
Add Graphics Script(
5,
Description( "" ),
Summarize( dt, byGroup = by( :PDK ) );
colorList = {"Blue", "red", "Green", "Green"};
Fill Pattern( [0] );
For( i = 1, i <= N Items( byGroup ), i++,
Pen Color( colorList[i] );
theRows = dt << get rows where(
:PDK == byGroup[i] & :skew != "tttt" & :skew != "ff" & :skew != "fs" & :skew != "sf" &
:skew != "ss"
);
If( Word( 2, byGroup[i], "/" ) == "a",
Line Style( "Dashed" )
);
theRows = theRows |/ theRows[1];
xMatrix = :nmos[theRows];
yMatrix = :pmos[theRows];
Line( xMatrix, yMatrix );
);
), Add Text Annotation(
Text( "cgate_per_um_Z120_dev1_s9999019999d9999019999" ),
Fixed Size( 0 ),
Text Box( {87, 62, 341, 134} ),
Background Color( "White" ),
Font( "Segoe UI", 14, "Plain" ),
Filled( 0 )
)}
)
)
)
Note: JSL copied into JSL object to assist in easier reading by TXNELSON
Re: JSL coding debug - help needed with "Label"The script you pasted isn't the same as my script as I have
Elements(Points(X, Y, legend(5), Label("Label by Row"))),
Show labels(1),
which you do not
Re: JSL coding debug - help needed with "Label"I tried that (snippet below). It still does not put Label in the graph. No clue what is wrong. Thanks

Re: JSL coding debug - help needed with "Label"To be honest, neither do I have any idea what is wrong. If I run the script I provided you with (with slight window resizing) I get this with JMP18

And this with JMP19

Re: JSL coding debug - help needed with "Label"Let me update the JMP version and see if that helps. Thanks much.