Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level IV

graph with different target or spec limits

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
Highlighted
Staff

Re: graph with different target or spec limits

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 . . .
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
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
Highlighted
Staff

Re: graph with different target or spec limits

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 . . .
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
PenColor("Orange"); HLine(65);
Transparency(0.25);
FillColor("Green");
Rect(50, 65, 180, 60, 1);
FillColor("Blue");
Rect(50, 70, 180, 65, 1);
);``````
Highlighted
Level IV

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

Highlighted
Staff

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.

Article Labels

There are no labels assigned to this post.