I have a script for plotting which works. I added the "By" function and it no longer works.
The error message is
FrameBox in access or evaluation of '<FONT color="#FF6600">FrameBox</FONT>'
Here is the original working script before modification.
CodeBlk=Expr(
colname = {"Column1", "Column2", "Column3"};
colabrv = {};
For (i=1, i<=Nitems(colname), i++, colabrv=Insert(colabrv,"Var"||Char(i)));
all_col = dtable << get column names( string );
If(!Contains(all_col, "Column_Grp"),
dtable << New Column ("Column_Grp",<BR /> Formula(If(:Tester_MD=="Tester1", "Tester1", "Other Testers")));
);
New Window("GRAPHS", Lineup Box(Ncol(2),
For( n = 1, n <= Nitems(colname), n++,
plotswp = "current data table(subdt);" ||<BR /> colabrv[n]||"_Max = col quantile( :Name( \!"" || colname[n] ||"\!" ), 0.5 )+(2*col Std Dev( :Name( \!"" || colname[n] ||"\!" ) ));"||<BR /> colabrv[n]||"_Min = col quantile( :Name( \!""||colname[n]||"\!" ), 0.5 )-<BR /> (2*col Std Dev( :Name( \!"" || colname[n] ||"\!" ) ));" ||<BR /> colabrv[n] || "_Step = Std Dev( :Name( \!""|| colname[n] || "\!" ) );" ||
"current data table(dtable);" ||<BR /> colabrv[n] ||"_Plot = Bivariate (Y( :Name( \!"" || colname[n] ||"\!" ) ), <BR /> X( :Name( \!"XColumn\!" ) ),group by (groupcol),<BR /> Fit Spline(1000));";
For( c = 1, c <= GroupListN, c++,<BR /> If(Right( GroupList[c], 3 ) == "OFF",<BR /> plotswp = plotswp || colabrv[n] ||"_Plot << (Curve[" || Char( c ) ||"]<BR /> << Line Style( Dashed ));",Right( GroupList[c], 3 ) == "ON",
plotswp = plotswp || colabrv[n] ||"_Plot << (Curve[" || Char( c ) ||"] << Line Width( 3 ));"));
plotswp2 = plotswp || colabrv[n] || "_Plot_r =" || colabrv[n]
|| "_Plot<<REPORT></REPORT> << Tick Font (style (1), size (12) << Show Major Grid (1)<BR /> << Show Minor Grid (0) << Show Minor Ticks (1);
Xaxis = " || colabrv[n] || "_Plot_r[Text Edit Box(2)]<BR /> << Set Font Size( 12 ) << Set Font Style( \!"Bold\!" ) ;
Yaxis << Max ("|| colabrv[n] || "_Max) << Min (" || colabrv[n] ||
"_Min) << Inc (" || colabrv[n] ||"_Step) <BR /> << Tick Font (style (1), size (12))
<< Show Major Grid (1) << Show Minor Grid (0)<BR /> << Show Minor Ticks (1);
Yaxis = "|| colabrv[n] ||"_Plot_r[Text Edit Box(1)] << Set Font Size( 12 )<BR /> << Set Font Style( \!"Bold\!" ) ; "
||colabrv[n]||"_Plot_Frame << {Frame Size( 240, 190 ), Marker Size( 1 ),<BR /> Line Width Scale( 3 )} ;";
plotswp2 = Eval( Parse( plotswp2 ) );
);
)
);
);Here is the modified script. I can't control the font color but what I added was this part "By(:ColumnGrp)" Everything else was the same.
CodeBlk=Expr(
colname = {"Column1", "Column2", "Column3"};
colabrv = {};
For (i=1, i<=Nitems(colname), i++, colabrv=Insert(colabrv,"Var"||Char(i)));
all_col = dtable << get column names( string );
If(!Contains(all_col, "Column_Grp"),
dtable << New Column ("Column_Grp",<BR /> Formula(If(:Tester_MD=="Tester1", "Tester1", "Other Testers")));
);
New Window("GRAPHS", Lineup Box(Ncol(2),
For( n = 1, n <= Nitems(colname), n++,
plotswp = "current data table(subdt);" ||<BR /> colabrv[n]||"_Max = col quantile( :Name( \!"" || colname[n] ||"\!" ), 0.5 )+(2*col Std Dev( :Name( \!"" || colname[n] ||"\!" ) ));"||<BR /> colabrv[n]||"_Min = col quantile( :Name( \!""||colname[n]||"\!" ), 0.5 )-<BR /> (2*col Std Dev( :Name( \!"" || colname[n] ||"\!" ) ));" ||<BR /> colabrv[n] || "_Step = Std Dev( :Name( \!""|| colname[n] || "\!" ) );" ||
"current data table(dtable);" ||<BR /> colabrv[n] ||"_Plot = Bivariate (Y( :Name( \!"" || colname[n] ||"\!" ) ), <BR /> X( :Name( \!"XColumn\!" ) ),group by (groupcol),<BR /> <STRONG><FONT color="#FF0000"> By(:ColumnGrp)</FONT></STRONG>, Fit Spline(1000));";
For( c = 1, c <= GroupListN, c++,<BR /> If(Right( GroupList[c], 3 ) == "OFF",<BR /> plotswp = plotswp || colabrv[n] ||"_Plot << (Curve[" || Char( c ) ||"]<BR /> << Line Style( Dashed ));",Right( GroupList[c], 3 ) == "ON",
plotswp = plotswp || colabrv[n] ||"_Plot << (Curve[" || Char( c ) ||"] << Line Width( 3 ));"));
plotswp2 = plotswp || colabrv[n] || "_Plot_r =" || colabrv[n]
|| "_Plot<<REPORT></REPORT> << Tick Font (style (1), size (12) << Show Major Grid (1)<BR /> << Show Minor Grid (0) << Show Minor Ticks (1);
Xaxis = " || colabrv[n] || "_Plot_r[Text Edit Box(2)]<BR /> << Set Font Size( 12 ) << Set Font Style( \!"Bold\!" ) ;
Yaxis << Max ("|| colabrv[n] || "_Max) << Min (" || colabrv[n] ||
"_Min) << Inc (" || colabrv[n] ||"_Step) <BR /> << Tick Font (style (1), size (12))
<< Show Major Grid (1) << Show Minor Grid (0)<BR /> << Show Minor Ticks (1);
Yaxis = "|| colabrv[n] ||"_Plot_r[Text Edit Box(1)] << Set Font Size( 12 )<BR /> << Set Font Style( \!"Bold\!" ) ; "
||colabrv[n]||"_Plot_Frame << {Frame Size( 240, 190 ), Marker Size( 1 ),<BR /> Line Width Scale( 3 )} ;";
plotswp2 = Eval( Parse( plotswp2 ) );
);
)
);
);If I remove the FrameBox part, the script works. But I need that part to customize my graphs; I can't delete it.
CodeBlk=Expr(
colname = {"Column1", "Column2", "Column3"};
colabrv = {};
For (i=1, i<=Nitems(colname), i++, colabrv=Insert(colabrv,"Var"||Char(i)));
all_col = dtable << get column names( string );
If(!Contains(all_col, "Column_Grp"),
dtable << New Column ("Column_Grp",<BR /> Formula(If(:Tester_MD=="Tester1", "Tester1", "Other Testers")));
);
New Window("GRAPHS", Lineup Box(Ncol(2),
For( n = 1, n <= Nitems(colname), n++,
plotswp = "current data table(subdt);" ||<BR /> colabrv[n]||"_Max = col quantile( :Name( \!"" || colname[n] ||"\!" ), 0.5 )+(2*col Std Dev( :Name( \!"" || colname[n] ||"\!" ) ));"||<BR /> colabrv[n]||"_Min = col quantile( :Name( \!""||colname[n]||"\!" ), 0.5 )-<BR /> (2*col Std Dev( :Name( \!"" || colname[n] ||"\!" ) ));" ||<BR /> colabrv[n] || "_Step = Std Dev( :Name( \!""|| colname[n] || "\!" ) );" ||
"current data table(dtable);" ||<BR /> colabrv[n] ||"_Plot = Bivariate (Y( :Name( \!"" || colname[n] ||"\!" ) ), <BR /> X( :Name( \!"XColumn\!" ) ),group by (groupcol),<BR /> <STRONG><FONT color="#FF0000"> By(:ColumnGrp)</FONT></STRONG>, Fit Spline(1000));";
For( c = 1, c <= GroupListN, c++,<BR /> If(Right( GroupList[c], 3 ) == "OFF",<BR /> plotswp = plotswp || colabrv[n] ||"_Plot << (Curve[" || Char( c ) ||"]<BR /> << Line Style( Dashed ));",Right( GroupList[c], 3 ) == "ON",
plotswp = plotswp || colabrv[n] ||"_Plot << (Curve[" || Char( c ) ||"] << Line Width( 3 ));"));
plotswp2 = plotswp || colabrv[n] || "_Plot_r =" || colabrv[n]
|| "_Plot<<REPORT></REPORT> << Tick Font (style (1), size (12) << Show Major Grid (1)<BR /> << Show Minor Grid (0) << Show Minor Ticks (1);
Xaxis = " || colabrv[n] || "_Plot_r[Text Edit Box(2)]<BR /> << Set Font Size( 12 ) << Set Font Style( \!"Bold\!" ) ;
Yaxis << Max ("|| colabrv[n] || "_Max) << Min (" || colabrv[n] ||
"_Min) << Inc (" || colabrv[n] ||"_Step) <BR /> << Tick Font (style (1), size (12))
<< Show Major Grid (1) << Show Minor Grid (0)<BR /> << Show Minor Ticks (1);
Yaxis = "|| colabrv[n] ||"_Plot_r[Text Edit Box(1)] << Set Font Size( 12 )<BR /> << Set Font Style( \!"Bold\!" ) ; "
||colabrv[n]||"_Plot_Frame << {Frame Size( 240, 190 ), Marker Size( 1 ),<BR /> Line Width Scale( 3 )} ;";
plotswp = Eval( Parse( plotswp ) );
);
)
);
);I checked in the FrameBox index is altered but it is still the same.
Any ideas on how do debug this?
Thanks.