If a simple graphics script is added to the Graph Builder object you can get what you want
names default to here(1);
// Create the data table
dt = New Table( "Example",
Add Rows( 27 ),
New Script(
"Source",
Data Table( "Untitled 60" ) << Split(
Split By( :Column 2 ),
Split( :Column 1 ),
Sort by Column Property
)
),
New Column( "x axis",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[2.3856, 2.3858, 2.4184, 2.2979, 2.2979, 2.3318, 2.3856, 2.3858, 2.4184,
2.5875, 2.5878, 2.6185, 2.8174, 2.8177, 2.8398, 2.9059, 2.9062, 2.9259,
2.8174, 2.8177, 2.8398, 2.5875, 2.5878, 2.6185, 2.5875, 2.5878, 2.6185]
)
),
New Column( "y axis",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[2.2608, 2.2616, 2.2919, 2.4459, 2.4463, 2.4758, 2.6498, 2.6499, 2.6742,
2.7302, 2.7302, 2.7532, 2.6498, 2.6499, 2.6742, 2.4459, 2.4463, 2.4758,
2.2608, 2.2616, 2.2919, 2.1817, 2.1827, 2.2138, 2.4459, 2.4463, 2.4758]
)
),
New Column( "label",
Character,
"Nominal",
Set Values(
{"a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "e", "e",
"e", "f", "f", "f", "g", "g", "g", "h", "h", "h", "i", "i", "i"}
)
),
New Column( "legend",
Character,
"Nominal",
Set Values(
{"set1", "set2", "set3", "set1", "set2", "set3", "set1", "set2", "set3",
"set1", "set2", "set3", "set1", "set2", "set3", "set1", "set2", "set3",
"set1", "set2", "set3", "set1", "set2", "set3", "set1", "set2", "set3"}
)
)
);
// Draw the scatterplot
gb = dt << Graph Builder(
Size( 531, 456 ),
Show Control Panel( 0 ),
Variables( X( :x axis ), Y( :y axis ), Overlay( :legend ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"x axis",
ScaleBox,
{Format( "Best", 12 ), Min( 2.273568 ), Max( 3.00134902479339 ),
Inc( 0.1 ), Minor Ticks( 0 )}
)
)
);
// Add a simple graphics script to connect the points
Report( gb )[FrameBox( 1 )] << add graphics script(
Summarize( dt, byGroup = by( :legend ) );
colorList = {"Blue","Red","Green"};
fill pattern( [0] );
For( i = 1, i <= N Items( byGroup ), i++,
Pen Color(colorList[i]);
theRows = dt << get rows where( :legend == byGroup[i] & :Label != "i" );
// Add the first value as the last value to complete the object
theRows = theRows |/ theRows[1];
xMatrix = :x axis[theRows];
yMatrix = :y axis[theRows];
line( xMatrix, yMatrix );
);
);
Jim