perthi
August 22, 2010, 11:23pm
1
I try to make a plot with 7 different graphs.
I want each graph to have a different color, and
I want the Legend to display the same color as the
graph, however all my legend indicates the graph is black,
this makes it impossible to use the legend to identify the individual graphs.
That atttached tarball reproduces the problem.
lut-test.tar (599 KB)
couet
August 26, 2010, 4:25pm
2
I cannot untar your file. I get the following message:
perthi
August 26, 2010, 4:38pm
3
I dont have any troubles untar this file ( just tried ).
What command do you use ?
couet
August 26, 2010, 4:43pm
4
tar xvf lut-test.tar …
It usually works …
perthi
August 26, 2010, 5:00pm
5
couet
August 27, 2010, 6:58am
6
Thanks. But it seems there is some missing files. I get:
and
Then I get two canvases: one with a plot on it and an empty one. But no legends.
perthi
August 27, 2010, 12:34pm
7
Hmm, seems to be limit ion the number of file I can upload at once.
A attach the missing two files.
ltu-emcal-t00.5-dt0.1-ped0.0-dped0.1.root (261 KB)
ltu-emcal-t00.0-dt0.0-ped0.0-dped0.1.root (274 KB)
couet
August 27, 2010, 12:49pm
8
You added the wrong objects in the legend. You should do:
leg->AddEntry(histos[0][0]->GetFunction("f00"),"Theory 0","l");
leg->AddEntry(histos[0][1]->GetFunction("f01"),"Theory 1","l");
leg->AddEntry(histos[0][2]->GetFunction("f02"),"Theory 2","l");
leg->AddEntry(histos[0][3]->GetFunction("f03"),"Theory 3","l");
leg->AddEntry(histos[0][4]->GetFunction("f04"),"Theory 4","l");
leg->AddEntry(histos[0][5]->GetFunction("f05"),"Theory 5","l");
leg->AddEntry(histos[0][6]->GetFunction("f06"),"Theory 6","l");