exclusiongraph.C

Go to the documentation of this file.
00001 TCanvas *exclusiongraph() {
00002    // Draw three graphs with an exclusion zone.
00003    //Author: Olivier Couet
00004    
00005    TCanvas *c1 = new TCanvas("c1","Exclusion graphs examples",200,10,600,400);
00006    c1->SetGrid();
00007 
00008    TMultiGraph *mg = new TMultiGraph();
00009    mg->SetTitle("Exclusion graphs");
00010 
00011    const Int_t n = 35;
00012    Double_t x1[n], x2[n], x3[n], y1[n], y2[n], y3[n];
00013    for (Int_t i=0;i<n;i++) {
00014      x1[i]  = i*0.1;
00015      x2[i]  = x1[i];
00016      x3[i]  = x1[i]+.5;
00017      y1[i] = 10*sin(x1[i]);
00018      y2[i] = 10*cos(x1[i]);
00019      y3[i] = 10*sin(x1[i])-2;
00020    }
00021 
00022    TGraph *gr1 = new TGraph(n,x1,y1);
00023    gr1->SetLineColor(2);
00024    gr1->SetLineWidth(1504);
00025    gr1->SetFillStyle(3005);
00026 
00027    TGraph *gr2 = new TGraph(n,x2,y2);
00028    gr2->SetLineColor(4);
00029    gr2->SetLineWidth(-2002);
00030    gr2->SetFillStyle(3004);
00031    gr2->SetFillColor(9);
00032 
00033    TGraph *gr3 = new TGraph(n,x3,y3);
00034    gr3->SetLineColor(5);
00035    gr3->SetLineWidth(-802);
00036    gr3->SetFillStyle(3002);
00037    gr3->SetFillColor(2);
00038 
00039    mg->Add(gr1);
00040    mg->Add(gr2);
00041    mg->Add(gr3);
00042    mg->Draw("AC");
00043 
00044    return c1;
00045 }

Generated on Tue Jul 5 15:44:22 2011 for ROOT_528-00b_version by  doxygen 1.5.1