cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles