Difference between revisions of "ForestErrAnal Lab7 Plot.C"
Jump to navigation
Jump to search
(Created page with 'void graph() { TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); const Int_t n = 3; Double_t x[n], y[n]; x[0]=1; y[0]=2; x[1]=2; y[1]=4; ...') |
|||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| + | <pre> | ||
| + | Double_t x[3], y[3]; | ||
void graph() { | void graph() { | ||
TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); | TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); | ||
| − | + | ||
| − | + | const Int_t n = 3; | |
x[0]=1; | x[0]=1; | ||
| Line 25: | Line 27: | ||
c1->Modified(); | c1->Modified(); | ||
} | } | ||
| + | |||
| + | </pre> | ||
| + | |||
| + | |||
| + | [[TF_ErrAna_InClassLab#Lab_7]] | ||
Latest revision as of 22:05, 28 February 2014
Double_t x[3], y[3];
void graph() {
TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);
const Int_t n = 3;
x[0]=1;
y[0]=2;
x[1]=2;
y[1]=4;
x[2]=6;
y[2]=12;
x[3]=10;
y[3]=20;
TGraph *gr = new TGraph(n,x,y);
gr->Draw("ACL");
c1->SetFillColor(42);
c1->SetGrid();
// TCanvas::Update() draws the frame, after which one can change it
c1->Update();
c1->Modified();
}