cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
swpatel
Level I

Graph builder - how to add max for x-axis and y-axis using script y-function

I am using graph builder-scatter plot. and adding different trend lines with different constant. and i want to add max for both x-axis and y-axis. how can i do that?

7 REPLIES 7
txnelson
Super User

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

You can get the max values for each of the Axes by 

gb = Graph Builder( ………………………………. );

maxX = report(gb)[AxisBox(1)] << get max;
max& = report(gb)[AxisBox(2)] << get max;

It would be helpful to be more specific on how you are going to use the max values in a trend line.

Jim
swpatel
Level I

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

First of all thanks for a very quick reply.
I want to basically show the trend line cut off for correlation purpose for x-axis and y-axis max allowable.
i was able to get the y-axis max (see picture how its maxed out at 530) but i cant figure out how to get the same for x-axis (I want to show max at 8).
i am using y function from script template.
txnelson
Super User

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

No picture in your response
Jim
swpatel
Level I

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

not sure why-heres the picture again-sorry about that.

Screen Shot 2020-04-28 at 2.37.29 PM.png

Screen Shot 2020-04-28 at 2.37.45 PM.png

txnelson
Super User

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

Why isn't this what you need, in getting the max values for each axis?

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
gb = dt << Graph Builder(
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ) )
);

show(report(gb)[AxisBox(1)] << get max,
	report(gb)[AxisBox(2)] << get max
);
Jim
swpatel
Level I

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

I am not sure-I can give it a try - but i wanted to know if my existing script derived from y function can be modified to set max for x-axis. heres the equation i am using Y Function (Min(C - M*X), 530 ), x );

-thanks much. appreciate your help and be safe.
txnelson
Super User

Re: Graph builder - how to add max for x-axis and y-axis using script y-function

I think all you are asking for is:


x = report(gb)[AxisBox(1)] << get max;
Jim