- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How do I combine multiple plots type into a single graph
Hello 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I combine multiple plots type into a single graph
You 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 )}
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I combine multiple plots type into a single graph
Hello, 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I combine multiple plots type into a single graph
Try building the chart with points first and then right click in the graph area and select Add > Line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I combine multiple plots type into a single graph
To 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I combine multiple plots type into a single graph
If 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 )}
)
);