TLegend and TGraphError

Hi,

I got a small problem. I’m trying to plot a TGraphError, and add a legend. However I can’t quite make
the legend work as I want…

So, I can do AddEntry(…,…,“lep”)

and I get a marker with errorbars AND horizontal lines, which I dont want since I plotted the graph without lines, i.e. only markers.

or I do AddEntry(…,…,“ep”)

and I get NO lines indicating that errors are given… any solutions? I include a small script to explain a bit
better what I want.

cheers

Joa

oups, wrong button, here is the script
legendsgraph.C (394 Bytes)

See the description of “TLegend::AddEntry”: http://root.cern.ch/root/html/TLegend.html#TLegend:AddEntry

Hi Pepe,

The information in the link you gave states that “e” draws the “errorsbars” if “l” also is given. But I only want the errorbars not the lines. Either there is a “hidden” way around this, or it can’t be done. Or I’m plain stupid, which of course always is an option :wink:

cheers

Joa

You need L . E alone doesn’t not work. See the exmaple here:
root.cern.ch/root/html/TLegend.html

Hi again,

I see… I disagree with this design decision :wink: so I added the option of a single “e” in the options that does what I want. I include the diff (TLegend.cxx) if anyone would be interested. My hack is hardly worth while to put into root but it does what I need it to do now

cheers

Joa
diff.txt (572 Bytes)

You request is reasonable.
I put the changes in the trunk.