Hi, I am fairly new to jmp and am trying to write a script to automate something I have been able to do in other software. I am not sure what I am wanting to do is possible. I am trying to use some data to overlay 2 graphs, one is a scatter plot and the other is a line graph. I am able to do the scatter plot, but cannot figure out how to include the line graph one as well. I have included some images of the 2 graphs I want to overlay, and also an example with other software of how it should look. I also will include what I have so far for my script. Thanks in advance for any assistance. framex_value = "";
w = New Window( "Frame size X", // opens a window with a title and this content...
<<Return Result,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Frame size X" ) ), // a second title, centered
Spacer Box( size( 1, 30 ) ), // a little vertical space
H List Box( Text Box( "Frame size X: " ), framex = Number Edit Box( "" ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Create graph", // this script runs when the button is pressed...
framex_value = framex << get text();
values1 = {framex_value, framex_value};
values2 = {1, 0.92, 0.92, 1};
column("X coordinate")<<data type(Numeric)<<Modeling Type(Continuous)<<Format(Best,12);
New Column ( "New Y", Numeric, Nominal, Width( 5), Formula(Round(Y coordinate)));
dt =Current Data Table();
dt << select where( :New Y != 50503 );
dt << delete rows;
New Column ( "Normalized", Numeric, Continuous, Width( 10 ), Precision ( 7 ), Formula(IntenCD/Col Max(IntenCD)) );
New Column ( "Frame X", Numeric, Continuous, Width( 10 ), Precision ( 7 ), set values( values1 ));
New Column ( "Frame X 2", Numeric, Continuous, Width( 10 ), Precision ( 7 ), Formula(76200 - (Frame X/2)));
New Column ( "Frame Y", Numeric, Continuous, Width( 10 ), Precision ( 7 ), set values( values2 ));
Graph Builder(
Variables( X( :X coordinate ), Y( :Normalized ) ),
Elements( Points( X, Y, Legend( 9 ) ) ),
//Variables( X( :Frame X ), Y( :Frame Y ) ),
Elements( Line( X, Y, Legend( 5 ), Row order( 1 ) ) ),
SendToReport(
Dispatch(
{},
"X coordinate",
ScaleBox,
{Min( 10000 ), Max( 140000 ), Inc( 10000 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"Normalized",
ScaleBox,
{Min( 0.91 ), Max( 1.01 ), Inc( 0.002 ), Minor Ticks( 1 )}
)
)
);
// launch a platform to analyze the data...
//dt << Distribution( Continuous Distribution( Column( :a ), Quantiles( 0 ), Summary Statistics( 0 ), Vertical( 0 ), Outlier Box Plot( 0 ) ) );
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);
... View more