Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Graph builder - how to add max for x-axis and y-axis using script y-function

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Apr 28, 2020 12:30 PM
(712 views)

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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.

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.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

No picture in your response

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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.

-thanks much. appreciate your help and be safe.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Article Labels

There are no labels assigned to this post.