Try the 'Group By...' option in 'Fit Y By X':
Names Default To Here( 1 );
// Make a table
n = 10;
t1Vals = (1::n)` + J(n, 1, RandomNormal(0, 0.05));
t2Vals = (1::n)` + J(n, 1, RandomNormal(0, 0.05));
dt = New Table( "Voltage and Temperature",
New Column( "V1", Numeric, Continuous, Formula( Random Normal() ) ),
New Column( "T1", Numeric, Continuous, Values(t1Vals)),
New Column( "V2", Numeric, Continuous, Formula( Random Normal() ) ),
New Column( "T2", Numeric, Continuous, Values(t2Vals))
);
dt << runFormulas;
// Stack the table
dt2 = dt << Stack(
columns( :V1, :T1, :V2, :T2 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Stack By Row( 0 ),
Number of Series( 2 ),
OutputTable("Voltage and Temperature Stacked")
);
Column(dt2, "Data 2") << setName("Temperature");
Column(dt2, "Data") << setName("Voltage");
dt2 << deleteColumn("Label 2");
dt2 << colorByColumn(:Label);
// Use 'Group By' in 'Fit Y By X' . . .
biv = dt2 << Bivariate(
Y( :Voltage ),
X( :Temperature ),
Fit Where( :Label == "V1", Fit Spline( 0.1, {Line Color( {208, 64, 86} )} ) ),
Fit Where( :Label == "V2", Fit Spline( 0.1, {Line Color( {64, 110, 211} )} ) )
);