Color of errorbars

hay
I would like to set the color of errorbars in a TGraphErrors. Does anybody know how to do this? SetMarkerColor sets only the marker color not the errorbars…
thanks
florian

It is SetFillColor() because the Line Color is for the graph line and also errors can be drawn as boxes so the fill color makes some sense some how.

thanks for the quick answer
but

tf->SetFillColor(4);

does not work… I googled it and I found this command only for histograms…?
or is my syntax wrong?
regards
florian

For me it works with the following little example:

{
   TCanvas *c1 = new TCanvas("c1", "c1",15,48,700,502);

   TGraphErrors *gre = new TGraphErrors(3);
   gre->SetName("Graph");
   gre->SetTitle("Graph");
   gre->SetFillColor(2);
   gre->SetLineColor(3);
   gre->SetLineWidth(3);
   gre->SetMarkerStyle(25);
   gre->SetPoint(0,1,1);
   gre->SetPointError(0,0,5);
   gre->SetPoint(1,2,4);
   gre->SetPointError(1,0,5);
   gre->SetPoint(2,3,9);
   gre->SetPointError(2,0,5);

   gre->Draw("AP2L");

}

if I use P2 in the draw command I get boxes instead of errorbars. These boxes have indeed the color which I specified with the SetFillColor command but actually I would like to have normal errorbars
I attached a plot, the blue boxed are the errorbars…
thanks
and regards
florian
ctf.pdf (16.4 KB)
ctf.pdf (16.4 KB)

Oh yes indeed you are right !! it was because there was no error along x in my case…
Here is the modified macro. It gives the attached plot.

{
   TCanvas *c1 = new TCanvas("c1", "c1",15,48,700,502);
   TGraphErrors *gre = new TGraphErrors(3);
   gre->SetName("Graph");
   gre->SetTitle("Graph");
   gre->SetLineColor(3);
   gre->SetMarkerStyle(24);
   gre->SetMarkerColor(2);
   gre->SetPoint(0,1,1); gre->SetPointError(0,0,5);
   gre->SetPoint(1,2,4); gre->SetPointError(1,0,5);
   gre->SetPoint(2,3,9); gre->SetPointError(2,0,5);
   gre->Draw("AP");
}


it works! thank you very much…