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
- :
- Discussions
- :
- graph with different target or spec limits

Topic Options

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

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

Jan 15, 2019 2:49 AM
(593 views)

hi,

I have a graph for 2 product (P and X) like this image below.

I would like to add a ref line and a colored zone specific for each product with the jsl of the graph.

Is it possible?

best regards

1 ACCEPTED SOLUTION

Accepted Solutions

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

Think you may have to resort to graphics scripts. Making this general would take some work, but is perfectly possible. Use 'Help > Scripting Index' for more details.

```
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Using the axis gives common values for the groups
gb1 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ),
SendToReport(
Dispatch(
{},
"height",
ScaleBox,
{Add Ref Line( {60, 65}, "Solid", "Green", "Middle", 1, 0.25 ),
Add Ref Line( {65, 70}, "Solid", "Medium Dark Cyan", "Top", 1, 0.25 ),
Add Ref Line( 65, "Solid", "Orange", "", 1 )}
)
)
);
// Different values for each group takes more work
gb2 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
gb2Rep = Report(gb2);
// Females . . .
gb2Rep[Framebox(1)] << addGraphicsScript(
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
gb2Rep[Framebox(2)] << addGraphicsScript(
PenColor("Orange"); HLine(65);
Transparency(0.25);
FillColor("Green");
Rect(50, 65, 180, 60, 1);
FillColor("Blue");
Rect(50, 70, 180, 65, 1);
);
```

3 REPLIES 3

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

Think you may have to resort to graphics scripts. Making this general would take some work, but is perfectly possible. Use 'Help > Scripting Index' for more details.

```
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Using the axis gives common values for the groups
gb1 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) ),
SendToReport(
Dispatch(
{},
"height",
ScaleBox,
{Add Ref Line( {60, 65}, "Solid", "Green", "Middle", 1, 0.25 ),
Add Ref Line( {65, 70}, "Solid", "Medium Dark Cyan", "Top", 1, 0.25 ),
Add Ref Line( 65, "Solid", "Orange", "", 1 )}
)
)
);
// Different values for each group takes more work
gb2 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
gb2Rep = Report(gb2);
// Females . . .
gb2Rep[Framebox(1)] << addGraphicsScript(
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
gb2Rep[Framebox(2)] << addGraphicsScript(
PenColor("Orange"); HLine(65);
Transparency(0.25);
FillColor("Green");
Rect(50, 65, 180, 60, 1);
FillColor("Blue");
Rect(50, 70, 180, 65, 1);
);
```

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

Re: graph with different target or spec limits

hi,

there is a pb.

If you exclude M and then re include M, you will have the same spec limits for F and M.

best regards

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

Re: graph with different target or spec limits

Yes.

If you hide the 'Males' (for example, by using a local data filter), the frame box that holds these points (in this case 'FrameBox(2)') is deleted from the display, along with the associated graphics script. When the 'Males' are unhidden, JMP will create the frame box it needs, but it will inherit the graphics script from the 'Females'. One could argue that it shouldn't do this, but then of course you would have no lines for the 'Males'.

I think you could get the behaviour you want by using a row state handler but it would take some work to make this general.