How to remove legend from my canvas (supplement: it was a stats box)

Dear Root experts,

I wonder how to remove a ‘legend’ from my canvas(or from my histogram).
I didn’t set anything about the legend, but Root automatically draw it.
How can I remove it?

Thanks


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


I suppose you mean the statistics box, not a TLegend.
Either do

gStyle->SetOptStat(0);

at the beginning of your macro, or

 yourhisto->SetStats(0);

before drawing ‘yourhisto’.

2 Likes

I’ve been doing stupid things. Thank you for your answer!