Error bars with square brakets at the end

Hi,
I would need some error bars which have at their end some … square brackets (the best description that I can think of :bulb: ). The closest option I found, was ‘e1’, but this doesn’t have little vertical ends on the horizontal line. Is there a way to create such thing in ROOT?
I’ve seen some plots which have these kind of error bars. Of course, I wouldn’t put my money on that all of them were made in ROOT… but it is true for the contrary too :frowning: , hence my question.
Also, for the e2 option (the one which draws a rectangle at each error bar), is there a way to draw an unfilled rectangle? (yes, I’m trying to go around to solve my first problem, draw an empty rectangle first, which has just a contour, and on top of it, a shorter but larger and white rectangle, that would give the impression of a error bar with brackets at ends :smiley:)

Thanks, Camelia

PS. this is what I would like to have:


| | |

|||

When I plot an histogram using option E1, I see the little bars on the horizontal line too. To have empty boxes with E2 do:
hpx->SetFillStyle(0);
Can you send an small example showing your problem with E1 ?

Yes. I do have the big vertical error bar, with a perpendicular horizontal bar (|). What I want, is to have some smaller perpendicular bars, at the end of this horizontal bar [-o< (|__| )

This is the little try macro.
{
gROOT->Reset();
c1 = new TCanvas(“c1”,“Histogram Drawing Options”,200,10,700,900);

hpx = new TH1F(“hpx”,“This is the px distribution”,100,-4,4);

// Fill histograms randomly
gRandom->SetSeed();
Float_t px,py;
const Int_t kUPDATE = 1000;
for ( Int_t i=0; i<25000; i++) {
gRandom->Rannor(px,py);
hpx->Fill(px);
}

hpx->SetMarkerStyle(21);
hpx->Draw(“e1”);

c1->Update();
}

These bars are there but they are hidden by the square markers because the markers as large as the bin width.

No,they are not.
I made the marker really small. What I was able to see, were the horizontal error bars (which are placed at the middle of the vertical error bars).
I need for the vertical error bars to have at their end, the horizontal lines with the little lines hanging down/staying up.


| | |

|||

What you can get with your macro it the attchaed picture. That is how E1 displays errors. There is no other way.

{
   c1 = new TCanvas("c1","Histogram Drawing Options",200,10,500,500);
   hpx = new TH1F("hpx","This is the px distribution",30,-4,4);
   // Fill histograms randomly
   gRandom->SetSeed();
   Float_t px,py;
   for ( Int_t i=0; i<25000; i++) {
      gRandom->Rannor(px,py);
      hpx->Fill(px);
   }
   hpx->SetMarkerSize(0.6);
   hpx->SetMarkerStyle(21);
   hpx->Draw("e1");
}

it gives the following result.