void td() { TCanvas *c1 = new TCanvas("c1", "c1",10,10,600,600); c1->SetGridx(); c1->SetGridy(); gStyle->SetOptStat("0000"); TH2F *h2 = new TH2F("h2","",4,0,2,4,0,2); h2->Draw(); h2->GetXaxis()->SetNdivisions(4); //h2->GetXaxis()->SetTitle("t"); h2->GetXaxis()->CenterTitle(true); h2->GetYaxis()->SetNdivisions(4); h2->GetYaxis()->SetTitle("j_{s}(#Omega,t)"); h2->GetYaxis()->CenterTitle(true); FILE *fp=fopen("/home/Administrator/out/data.prn","r"); TFile *f=new TFile("data.root","RECREATE"); TTree *t=new TTree("T","data from ascii file"); Float_t x[200][1201]; t.Branch("x",x,"x[200][1201]/F"); Int_t row,column; for(row=0;row<200;row++) { for(column=0;column<1201;column++) { fscanf(fp,"%f",&x[row][column]); //printf("%.3f ",x[row][column]); } printf("row=%d\n",row); t->Fill(); } for(column=1;column<1201;column++) { h2->Draw(); t->SetMarkerColor(4); t->SetMarkerStyle(20); t->SetMarkerSize(0.3); t->Draw(Form("x[][%d]:x[][0]",column),"","same"); h2->SetTitle(Form("#Omega=%.3f",column*0.01)); h2->GetXaxis()->SetTitle(Form("#Omega=%.3f",column*0.01)); c1->Print(Form("/home/Administrator/pic/%d.gif",column)); } c1->Modified(); }