Hello. I am tryiing to make a bar graph, with certain set Axis. I have the following macro:
{
gROOT->Reset();
c1 = new TCanvas(“c1”,“Inefficencies”,200,10,700,500);
c1->SetFillColor(0);
// draw a frame to define the range
TH1F *hr = c1->DrawFrame(0.0,2500,60,2750.0);
hr->SetTitle(“Number of Raw Rechits Per Charge Cut for Chamber 2227”);
hr->SetXTitle(“Charge Cut”);
hr->SetYTitle(“Number of Raw Rechits”);
Int_t n1 = 23;
Float_t x1[] = {0, 0, 0, 10., 0, 0, 0, 20., 0, 0, 0, 30., 0, 0, 0, 40., 0, 0, 0, 50., 0, 0, 0};
Float_t y1[] = {0,0,0,2729,0,0,0,2733,0,0,0,2713,0,0,0,2665,0,0,0,2588,0,0,0};
TGraph *gr1 = new TGraph(n1,x1,y1);
gr1->SetFillColor(45);
gr1->SetMarkerColor(kBlue);
gr1->SetMarkerStyle(21);
gr1->SetLineColor(0);
gr1->Draw(“LP”);
}
The problem is that the “SetFillColor” doesn’t seem to do anything-I only have the markers. If i try to change the option in Draw from “LP” to “AB” as is shown in the example in the ROOT manual, I end up with 2 sets of axis super-imposed on each other. How do I handle this?
Also, How to I set the font-size of the axis labels to something smaller? I am new at this, and could use some help.
Thank you, Nicole