Legend for TGraphErrors with "[ ]" draw option

Dear Rooters,

I have a TGraphErrors object that I plot with the nice “[ ]” draw option. However, when I add it in the legend using “AddEntry” the “[ ]” is not reproduced in the entry. Looking at the TLegend documentation it seems this option is not supported.

Please could you tell me what is the best solution to get a legend entry adapted to the “[ ]” draw option?

Thanks a lot for your help
Best wishes
Matthias

1 Like

Can you post a small example showing the problem you encounter ? I am not sure what should be done with this option in TLegend.

Dear couet,

please enclosed a short example. No error bars appear for the entry “Total exp. uncertainty” of the TLegend.

Thank you for your help
Best wishes
Matthias
test.cxx (1.11 KB)

The option [] does not exist in TLEgend. See the doc. You should use the option E

Dear Olivier,

thank you for your message. I am aware of that. The issue is that if I use “E” a simple vertical bar appears. I would like a point with the error bars of the “[ ]” style, so ideally an option “[]” could be added in TLegend so that I can use “P[]” to get a point with “[” “]”. Would that be possible?

Please tell me if something is still not clear.

Best wishes
Matthias

It is clear . But it is not implemented,

Dear Olivier,

thank you for your answer, this is also pretty clear

So I will continue using inkskape to fix this by hand (which is very painful).

Cheers
Matthias

Can you show what the result you obtain with inkscape ? we might implement the same in TLegend.

Dear Olivier,

Sorry for the late answer, I missed your message. you can see the final results here: https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/STDM-2015-15/

Fig. 4 for instance.

Hope this helps
Best wishes

Thanks. I see now. I will see what can be done.