Why the legends are not colored?

Hi rooters,

Could some kind soul teach me why the legends (for TGraphErrors and TF1) are NOT colored with the attached script? :confused:
(v5.23.04 on Fedora 10 linux(x86_64))

Thanks in advance.

Yours,
Kazuyoshi
gel.C (860 Bytes)

You will find the answer here:
root.cern.ch/root/html/TLegend.html

Hi,

[quote=“couet”]You will find the answer here:
root.cern.ch/root/html/TLegend.html[/quote]

They’re colored when they are added to the TLegend by pointers to the objects, not by names , though I don’t still understand the difference… :confused:

Kazuyoshi

It is explain in the page I send you …
The TGraphs have no name by default. Read carefully the page I sent you.

Hi, thanks for your reply:

[quote=“couet”]It is explain in the page I send you …
The TGraphs have no name by default. Read carefully the page I sent you.[/quote]

Then, how about TF1, which has its name?

Yours
Kazuyoshi

All the cases are shown in the example on this page:
root.cern.ch/root/html/TLegend.html

TH1, TF1, TGraph etc … have a look … this example works. It shows all cases. (click on the “Source” tab to see the code).

Hi,

[quote=“couet”]All the cases are shown in the example on this page:
root.cern.ch/root/html/TLegend.html

TH1, TF1, TGraph etc … have a look … this example works. It shows all cases. (click on the “Source” tab to see the code).[/quote]

Just to excuse; I did, repeatedly, before asking…

As for the name of the graph, I did SET the name in my real code, but I forgot in the example script.

The legend for TF1 is coloured when Draw(“same”)n after Fit() but before AddEntry() by name…

Anyway, thanks.

Kazuyoshi