Turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Custom function over limited x range?

- 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

Mar 17, 2015 10:07 AM
(8873 views)

I am adding a function to a graphic (e.g., fit y- by- x) via "Customize Graph": Y Function**(**_function_of_x_, x**)**;

Can I limit the range of the x's that go into the function such that the function only plots over part of the range of the plot? So if my x-axis spans from 0 to 100 I only want my function to plot say from x= 50 to 100.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

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

You should be able to add an IF function around your "_function_of_x_". In other words:

Y Function( If( 50<x<100, _function_of_x_ ), x );

If x is not in that range, no value is produced.

3 REPLIES 3

Highlighted

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

You should be able to add an IF function around your "_function_of_x_". In other words:

Y Function( If( 50<x<100, _function_of_x_ ), x );

If x is not in that range, no value is produced.

Highlighted
##

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

Re: Custom function over limited x range?

Try the optional Min() and Max() arguments.

dt = Open**(**"$SAMPLE_DATA/Big Class.jmp"**)**;

biv = dt << **Bivariate****(**Y**(**:Weight**)**, X**(**:Height**))**;

Report**(**biv**)[**Framebox**(****1****)]** << **add graphics script****(**Y Function**(****3** * x - **90**, x, Min**(****60****)**, Max**(****70****)))**;

Highlighted
##

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

Re: Custom function over limited x range?

Excellent, both methods work as does

Y Function (If ( (x>50) & (x<100), function_of_x,) x);

I think I like the Min/Max solution best as the parentheses structure is easier to follow (i.e., less prone to error).

Y Function (function_of_x, x, Min(a), Max(b));

Article Labels

There are no labels assigned to this post.