cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Neo
Neo
Level VI

How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

I am coming from here

https://community.jmp.com/t5/Discussions/How-to-programmatically-enable-quot-Show-as-Graph-Reference... 

where I got help to enable "Show as Graph Reference Lines" programmatically. However the USL and LSL blue lines are shown at the extremities of the y-axis when I generate box-plots or distribution via the Graph Builder. This is not satisfactory. I have attached the data table with plotting script inside to show the effect.

(This is not the case for the example shown in the post I linked above for some reason! why?) 

Neo_0-1683808456997.png

 

I would like to auto-scale the y-axis each time I plot a column in my actual data which all have different limits and scales so that the horizonal blue lines for LSL/USL are always visible on the y-axis. How to achieve this in JSL?

 

When it's too good to be true, it's neither
6 REPLIES 6
Neo
Neo
Level VI

Re: How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

I have searched the scripting index but did not get anywhere. Any leads would be appricated. 

When it's too good to be true, it's neither
jthi
Super User

Re: How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

Depends on your application and on your data (auto-scaling might be difficult to implement, if JMP doesn't do good enough work for you). For example your table script works fine for me

jthi_4-1683886646010.png

h

-Jarmo
Neo
Neo
Level VI

Re: How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

@jthi I am on JMP 16.2.0. Which JMP version is yours?

When it's too good to be true, it's neither

Re: How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

Like Jarmo, the autoscaling works ok for your script in my iteration of JMP.

It is possible to do this in JSL though (and I'm sure that better JSL scripters than me would produce cleaner code than me!) by using the axis settings:

dt= current data table();
Lim = dt:data << Get Property ("Spec Limits");  //gets array of Spec limits for named column

// Use Spec limit values to set Axis limits (currently as Spec limit +/-10)
dt:data << Set Property(
	"Axis",
	{Min( (Lim ["LSL"]-10) ), Max( (Lim ["USL"]+10) ), Inc( 10 ), Minor Ticks( 1 )}
);

This works for the data column in the table you shared, and shouldn't take to much change to loop through a number of columns in a table

 

Stuart

 

Neo
Neo
Level VI

Re: How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

@Stuart_Little  Thanks but this does not appear to be generic solution (due to the +/- 10).

When it's too good to be true, it's neither

Re: How to show USL/LSL lines enabled via the property "Show as Graph Reference Lines" in box-plots/distribution via Graph Builder?

Hi @Neo

The +/-10 was just to illustrate the point - it's simple to set the Axis limits to +/-5% instead by changing to something like the below:

 

dt= current data table();
Lim = dt:data << Get Property ("Spec Limits");

// Change column property: data
dt:data << Set Property(
	"Axis",
	{Min( (Lim ["LSL"]*.95) ), Max( (Lim ["USL"]*1.05) ), Inc( 10 ), Minor Ticks( 1 )}
);

Of course, taking this approach will still run into issues if your data breaches both your spec limit, and whatever level you choose for the axis limit.

 

As you're on 16.2.0, the easiest first point of call would be to ask your site JMP representative to upgrade to JMP 17  to see if that helps resolve the issue - As I said, I can't duplicate your exact problem when I run your script in 17.1, so that will hopefully be the simplest way to resolve this!