Hello, I'm using this peace of code to display two graphes and fit them and it works quiete well. If I put the Print statment behind the Draw-Command I get a segfault. (The same thing happens if I try to print it as PS from the manu). Printing as root-file or root-macro works fine. Does somebody have an explanation? Thomas. PS: I'm using 2.25 on Alpha. The code is running in a compiled program. ------------------------------------------------------------------------- const char *t = "Title"; TCanvas *c = new TCanvas(t, t); c->SetLogx(); c->SetLogy(); TF1 *f1 = new TF1("powerlaw", "[0]*x^[1]*exp(-x/[2])", x[0][0], x[0][17]); f1->SetLineWidth(1); f1->SetParameter(0, 9.7e-11); f1->SetParameter(1, -2); f1->SetParameter(2, 1); f1->SetParName(0, "A"); f1->SetParName(1, "alpha"); f1->SetParName(2, "E0"); TF1 *f2 = new TF1("powerlaw2", "[0]*x^[1]", x[0][0], x[0][17]); f2->SetLineWidth(1); f2->SetParameter(0, 9.7e-11); f2->SetParameter(1, -2); f2->SetParName(0, "A"); f2->SetParName(1, "alpha"); TGraphAsymmErrors *th1f = new TGraphAsymmErrors(18-1, x[0], y[0], x[2], x[1], y[2], y[1]); th1f->SetTitle(NULL); th1f->SetMarkerStyle(3); th1f->SetMinimum(1e-15); th1f->SetMaximum(1e-9); th1f->Draw("A*"); TGraphAsymmErrors *th2f = new TGraphAsymmErrors(18-1, x[0], y1[0], x[2], x[1], y1[2], y1[1]); th2f->SetMarkerStyle(3); th2f->SetMinimum(1e-15); th2f->SetMaximum(1e-9); th2f->Draw("*"); TH1F *hist=th1f->GetHistogram(); hist->SetXTitle("X Title"); hist->SetYTitle("Y Title"); th1f->Fit("powerlaw2"); th2f->Fit("powerlaw"); c->Print("testfile.ps","psLandscape"); c->Update();
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:31 MET