- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Adding mean line by script
I can build a graph and add a horizontal mean line. When I try to extract the script it doesn't reproduce any line.
I have attached the script below
Graph Builder(
Size( 1964, 1192 ),
Variables( X( Column ), Y( Column ), Group X( Column_a ) ),
Elements( Bar( X, Y, Legend( 11 ) ), Line( Y, Legend( 12 ) ) ),
Local Data Filter(
Add Filter( columns( Column_a ), Where( Column >= 0 & Column_a <= 3.2 ) )
),
SendToReport(
Dispatch( {"Line"}, "", OutlineBox, {Close( 0 )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
11,
Properties( 0, {Fill Color( 0 )}, Item ID( "Column", 1 ) )
)}
)
)
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding mean line by script
I overlayed the two graphs onto one plot by adding the script for the line graph I wanted into the elements section of the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding mean line by script
You'll need to provide more information -- How are you adding the line? Can you provide a script that uses an example data table so that we can test?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding mean line by script
Here is an example of adding a Line to an existing Graph Builder plot
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y ), Smoother( X, Y ) )
);
gbb = Report( gb )[Graph Builder Box( 1 )];
gbb << Add Element( 1, 1, {Type( "Line" ), X, Y} );
The documentation for the messages that can be sent to Graph Builder are found in the Scripting Index.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding mean line by script
Thank you, this works to add a line but I was wondering how I can change it so that the line is a horizontal line displaying the mean Y variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding mean line by script
Go to the Scripting Index and search on
add ref line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding mean line by script
I overlayed the two graphs onto one plot by adding the script for the line graph I wanted into the elements section of the script