{ // Header gROOT->Reset(); gROOT->SetStyle("Plain"); #include "Riostream.h"; // Konstanten & Arrays Int_t files=8; Int_t lines = 2046; Double_t x[files][lines], y[files][lines], z[files][lines]; // Iteration über alle files for(Int_t i=0;i> x[i][n] >> y[i][n] >> z[i][n]; if(!in.good()) break; n++; } in.close(); //cout << "x" << i << "[2045] = " << x[i][2045] << " <--> " << "y" << i << "[2045] = " << y[i][2045] << endl; // Canvas & Style TCanvas *c[files]; c[i] = new TCanvas(Form("c%d",i), Form("Canvas %d", i), 1); TPad *pad_a[files]; TPad *pad_b[files]; pad_a[i] = new TPad(Form("pad_a[%d]",i),"",0,0,1,1); pad_b[i] = new TPad(Form("pad_b[%d]",i),"",0,0,1,1); pad_a[i]->SetGrid(); pad_b[i]->SetFillStyle(4000); pad_b[i]->SetFrameFillStyle(0); TLegend *leg = new TLegend(0.6,0.86,0.93,0.995,header=0,option = "NDC"); // Graphen TGraph *chaos[files]; TGraph *treib[files]; chaos[i] = new TGraph(n, x[i], y[i]); treib[i] = new TGraph(n, x[i], z[i]); cout << Form("graphs generated...chaos[%d]",i) << ", " << Form("treib[%d]",i) << endl; chaos[i]->GetXaxis()->SetTitle("t / s"); chaos[i]->GetYaxis()->SetTitle("U / V"); treib[i]->GetYaxis()->SetTitle("U / V"); treib[i]->SetLineColor(kRed); leg->AddEntry(chaos[i], "Diode","L"); leg->AddEntry(treib[i], "treibende Spannung","L"); // zusätzliche Achse TAxis *rechtsY[files]; rechtsY[i] = treib[i]->GetYaxis(); rechtsY[i]->SetLabelColor(kRed); rechtsY[i]->SetLineColor(kRed); treib[i]->GetYaxis()->SetTitleColor(kRed); cout << "---------------------" << endl; } // Bereiche festlegen rechtsY[0]->SetRangeUser(-1, 5); rechtsY[1]->SetRangeUser(-2, 5); rechtsY[2]->SetRangeUser(-4, 6); rechtsY[3]->SetRangeUser(-4.5, 18); rechtsY[4]->SetRangeUser(0,40); rechtsY[5]->SetRangeUser(-15, 30); rechtsY[6]->SetRangeUser(-15, 30); rechtsY[7]->SetRangeUser(-10, 80); for(i=0;iUpdate(); c[i]->cd(); pad_a[i]->Draw(); pad_a[i]->cd(); treib[i]->Draw("ALY+"); pad_b[i]->Draw(); pad_b[i]->cd(); chaos[i]->Draw("AL"); leg->Draw(); // Ausgabe c[i]->Update(); TString printname = "wic_"; printname +=i; printname +=".eps"; c[i]->Print(printname); } }