Subscribe Bookmark RSS Feed

use script to zoom out in bivariate fit

Masood

New Contributor

Joined:

Apr 27, 2017

Hi All

I am very new to sas jmp scripts. I have a lot of data that i routinely plot using fit y by x and i use a script for this, however, I manually have to drag the y-axis in the plot to make the graphs look nice and to have a better overview. Is there any way to change the standard scaling of the y-axis, either by a script or in a setting?

Thanks :)

5 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Here is the example taken directly from

     Help==>Scripting Index==>Axis Box

That illustrates the answer to your question.  Almost every element in your graphical displays dan be dynamically modified in JSL.  The Scripting Index is the key to learning how to handle all of the options.

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = Bivariate(
	Y( :weight ),
	X( :height ),
	FitLine
);
rbiv = biv << report;
axisbox = rbiv[axis box( 1 )];
axisbox << Min( 100 );
Jim
Masood

New Contributor

Joined:

Apr 27, 2017

Thanks Jim
The script works excellent when i only have one variable in the "y column". Usually i have 7-8 variables and use the "By(" function and get 7-8 plots. These plots are all on different scales.
The solution i am looking for would zoom to 50% of standard regardless of variable.

Masood
txnelson

Super User

Joined:

Jun 22, 2012

Masood,

The script I included in my last response, is just an illustration of a simple case.  It should not be viewed as being a final solution to whatever the specifics are to your particular problem.  The specifics that you provided do not show that what you want can not be done.  It also does not show that what I provided is incorrect.  Your specific requirements are just a more complex implementation.  What you need to do is to take the knowledge you were shown in my example, and expand it to meet the needs of your more complex problem. 

Jim
Masood

New Contributor

Joined:

Apr 27, 2017

Thanks for the help, I will need to work more on this. I will return when i have a solution !

Craige_Hales

Staff

Joined:

Mar 21, 2013

here's some starter code that might help, watch the JMP log window for the showProperties and watch the graph for the <<min(40). The showProperties is probably less helpful than the scripting index but I use it sometimes when I'm hunting for a message.

dt = open("$sample_data/big class.jmp");
biv = dt<<Bivariate(
	Y( :weight ),
	X( :height ),
	Fit Line( {Line Color( {213, 72, 87} )} ),
	SendToReport( Dispatch( {}, "Linear Fit", OutlineBox, {Close( 1 )} ) )
);

ax1 = report(biv)[axisbox(1)];
ax2 = report(biv)[axisbox(2)];

showproperties(ax1);

show( ax1<<getmin, ax1<<getmax, ax2<<getmin, ax2<<getmax );

ax1<<min(40);
Craige