Hi all,
I expect to plot a series of curves (or vectors of a field) on one single canvas, e.g. such functions: f(x)=x^2+Ci, where Ci is a constant varies from 1 to 100. I tried to use codes below but failed.
//++++++++++++++++++++++start+++++++++++++++++++++++++++++++double testfunc(double* x, double* par) { double c = par[0];
void fieldraw() {
for (double Ci=1;Ci<=100;Ci++)
{
TF1* vectorfunc = new TF1("vectorfunc",&testfunc,-5,5,1);
vectorfunc->SetParameters(Ci);
vectorfunc->Draw("L");
}
return;
}
//++++++++++++++++++++++end++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++// OR
//++++++++++++++++++++++start+++++++++++++++++++++++++++++++double testfunc(double* x, double* par) { double c = par[0];
void fieldraw() {
TF1* vectorfunc = new TF1("vectorfunc",&testfunc,-5,5,1);
for (double Ci=1;Ci<=100;Ci++)
{
vectorfunc->SetParameters(Ci);
vectorfunc->Draw("L");
}
return;
}
//++++++++++++++++++++++end++++++++++++++++++++++++++++++
Thr error message both are: "Error: Can't call TF1::SetParameters(Ci) in current scope"
I am puzzled what is going wrong?
Any tips will be greatly appreciated. Thanks and have a nice day!
Sincerely,
Shrinking
This archive was generated by hypermail 2.2.0 : Wed Jan 30 2008 - 11:50:01 CET