I've put together a script that should do what you want. It starts with a table with four columns: x1, y1, x2, y2.
The problem is that you need to stack x2 and y2 below x1 and y1, and add a column differentiating the two sets of data. This is the sort of result you want to end up with:
Here's the script. Note that the first few lines define a table similar to yours, referenced by the variable dt.
// Create an example table
dt = New Table( "Untitled 2", Add Rows( 4 ),
New Column( "x1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 2, 3, 4] ) ),
New Column( "y1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [4, 2, 3, 1] ) ),
New Column( "x2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [3, 5, 7, 8] ) ),
New Column( "y2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [5, 2, 8, 2] ) )
);
// For your case you would point the dt variable to your own table.
// dt = data table("My Data Table");
nr = nrows(dt);
// Make the new table
newdt = New Table( "Untitled 5",
Add Rows( 2 * nr ),
New Column( "x", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "y", Numeric, "Continuous", Format( "Best", 12 ) ),
New Column( "Machine", Character, "Nominal")
);
// In the next section of code, replace x1 and y1 with your column names for the first x-y pair
// Start with X1, Y1
for (i = 1, i <= nr, i++,
newdt:x[i] = dt:x1[i];
newdt:y[i] = dt:y1[i];
newdt:Machine[i] = "A";
);
// In this section of code, replace x2 and y2 with your column names for the second x-y pair
// Now add X2, Y2
for (i = (nr + 1), i <= 2 * nr, i++,
newdt:x[i] = dt:x2[i - nr];
newdt:y[i] = dt:y2[i - nr];
newdt:Machine[i] = "B";
);
// Create the graph
newdt << Graph Builder(
Size( 886, 452 ),
Show Control Panel( 0 ),
Variables( X( :x ), Y( :y ), Overlay( :Machine ) ),
Elements( Line( X, Y, Legend( 13 ) ), Points( X, Y, Legend( 14 ) ) )
);
To run this code, copy it to the clipboard. In JMP hit CTRL-T to open up a new script window, paste the code, and then hit CTRL-R to run it.
I would have preferred to come up with an easier solution using Tables > Stack, but couldn't figure out how to make that work (here's a challenge for all you JMP users!). This script is the next best thing.