Displaying data of several histograms simultaneously

Hello, I combined several histograms using the function a. I can somehow do it so that on the right is displayed what color is the data shown? Or can this be done only manually using latex, as in the attached file?

allpoint_v1.pdf (14.9 KB)


Please read tips for efficient and successful posting and posting code

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


TLegend

I open the root file in a TBrowser, make a TLegend and nothing is added. You need to create it as a separate object, then use AddEntry to add histogram data and then draw? You can’t do all this in an open histogram?

yes or use BuildLegend

I do not know what an "open histogram"is.

Generally speaking it will be difficult to create a legend form the browser only. You need to do some typing at the ROOT prompt or in a macro. Have a look at the documentation I sent you.

Graphically, once all the histos (or the canvas containing them) are drawn you can right click on the blank area outside the frame of the histogram/s, which will show a TCanvas menu; from here, select BuildLegend, then accept or adjust the options it will show and this should show the legend you want. But it is better to do this in code (open the histos, create legend, draw), as couet suggests.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.