faca87
November 29, 2022, 10:48am
1
Hello, I used the commands in my macro
f2->GetXaxis()->SetTitle("Ep (eV)");
f2->GetYaxis()->SetTitle("Height");
but I don’t get the titles…
lorfun.cpp (4.7 KB)
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
couet
November 29, 2022, 10:53am
2
The first plot is f1
. You should set the tite on f1
.
...
f1->Draw();
f1->GetXaxis()->SetTitle("aaaa");
f2->Draw("SAME");
...
faca87
November 29, 2022, 11:23am
3
Hi couet, I modified
lorfun.cpp (4.7 KB)
but I still don’t get the title
faca87
November 29, 2022, 12:15pm
5
Thank you @couet it works…I see that you just used
f1->SetTitle without the GetXaxis…but why did it work for you (You attached the pic) and not for me?
couet
November 29, 2022, 12:19pm
6
Before you did:
f1->GetXaxis()->SetTitle("x title")
f1->SetTitle(); // this erase the X tile
… you can set the 3 titles in one go:
f1->SetTitle("title ; x title ; y title");
system
Closed
December 23, 2022, 9:12am
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.