cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hasanurkhan
Level II

JSL coding debug - help needed with "Label"

Hello,

 

In my JSL code, I am using 

dtt<<Set Label Columns (:skew);

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

17 REPLIES 17
jthi
Super User

Re: 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)

jthi_0-1763674479073.png

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")))
);
-Jarmo
hasanurkhan
Level II

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<<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));
 
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 )}
)}
),
hogi
Level XIII

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:

hogi_0-1763676860912.png

Getting fast helpful answers to your questions 
Getting correct answers to correct questions quickly 

hogi
Level XIII

Re: JSL coding debug - help needed with "Label"

 you have to activate the labels in the control panel:

hogi_0-1763677659185.png

 

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 ) )
);

hogi_2-1763675289298.png

 

hogi
Level XIII

Re: JSL coding debug - help needed with "Label"

As an alternative, you can tag rows with the "label" flag - and show labels for the tagged rows:

hogi_4-1763675472574.png

 

hasanurkhan
Level II

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

hogi
Level XIII

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.

hasanurkhan
Level II

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.

jthi
Super User

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

jthi_0-1763702068512.png

My guess is that your problems are within the graphic script. I'm not exactly sure what you are trying to do within it? 

-Jarmo

Recommended Articles