TGraph Options

Hello. I am tryiing to make a bar graph, with certain set Axis. I have the following macro:


c1 = new TCanvas(“c1”,“Inefficencies”,200,10,700,500);

// 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);


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

The graph options description is:

To draw a fill area use “F” or “B”. Then the filled area attributes will be active.
If you use “A” axis are drawn, but as you already draw the axis before, a 2nd set of axis is drwan. You can also use the graph editor to understand the various options. Then save the canvas in a ".C " file and you will see how to reproduce the changes in a macro.