How do I combine multiple plots type into a single graphHello everyone,
I just want to add "by hands" control limits to a variable, but the issue is that the limits are not constant and vary according to the sample studied.
Do you know if it is possible to put on the same graph points (from the variable) and lines (from the control limits)?
Thank you in advance,
Regards
GraphicsRe: How do I combine multiple plots type into a single graphYou can add custom lines to most graphs in JMP by right clicking the axis and selecting Axis Settings, then manually adding a line in the Reference Lines section.
If you're looking to do this programmatically (you mention that the lines you want to add are variable), this can be done as well. Screenshot and script below.

dt = open ("$SAMPLE_DATA\Big Class.jmp");
var = 145;
Graph Builder(
Transform Column( "Row", Formula( Row() ) ),
Size( 794, 355 ),
Show Control Panel( 0 ),
Variables( X( :Row ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 4 ), Jitter Limit( 0.9541 ) ) ),
SendToReport(
Dispatch(
{},
"weight",
ScaleBox,
{Add Ref Line( var, "Solid", "Red", "Custom Limit", 1 )}
)
)
);
Re: How do I combine multiple plots type into a single graphHello, and thank you for your answer.
I knew that the solution right click and add lines would work, but the fact that the limits were variable made it impossible to use.
In fact, the limits were calculated and added to the database in order to be associated with the right sample, that's why I m searching for a way to add lines and points to the same graph
Re: How do I combine multiple plots type into a single graphTry building the chart with points first and then right click in the graph area and select Add > Line.
Re: How do I combine multiple plots type into a single graphTo add variable lines to a graph try something like this:
dt = open("$Sample_data\Big Class.jmp");
upper_limit = 65;
lower_limit = 55;
gb = dt << Graph Builder(
Size( 525, 454 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 9 ) ) ),
SendToReport(
Dispatch(
{},
"height",
ScaleBox,
{Add Ref Line( upper_limit, "Solid", "Dark Red", "Upper Limit", 2 ),
Add Ref Line( lower_limit, "Solid", "Dark Blue", "Lower Limit", 2 )}
)
)
);

The way I did this was by:
- Creating the graph
- Adding the upper and lower limit lines using constant values.
- Right-clicked the red triangle and saved the script.
- I replaced the constant values with variables.
Re: How do I combine multiple plots type into a single graphIf you want to add the lines separately here's how to do it:
gb2 = dt << Graph Builder(
Size( 525, 454 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 9 ) ) ),
);
gb2 << sendtoreport(
Dispatch( {}, "height", ScaleBox,
{Add Ref Line( upper_limit, "Solid", "Dark Red", "Upper Limit", 2 ),
Add Ref Line( lower_limit, "Solid", "Dark Blue", "Lower Limit", 2 )}
)
);