bou
October 5, 2022, 9:53am
1
Dear,
I used this method to add a TLatex to a TGraph TGraph Point Label
How may I remove it?
Thank you
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
couet
October 5, 2022, 11:13am
2
Right click on it and delete it.
bou
October 5, 2022, 11:24am
3
Thank you for your reply.
Sorry for the misunderstanding, I mean once it’s added if I further need to remove it using C++ code.
Best regards,
couet
October 5, 2022, 11:31am
4
Do you have the TLatex Definition in your code?
bou
October 5, 2022, 11:34am
5
I have something like this:
TLatex* tlatex = new TLatex(x, y, "label");
tg->GetListOfFunctions()->Add(tlatex);
bou
October 5, 2022, 11:42am
7
The thing is I need to display the TGraph with the label and further without… I can indeed recreate the TGraph without, but I thought there was a “simple” way to simply remove the label.
couet
October 5, 2022, 11:46am
8
GetListOfFunctions
returns a TList. Use the Remove method of TList.
bou
October 5, 2022, 12:02pm
9
OK thank you I found a way to do it using:
gr->GetListOfFunctions()->Remove(
gr->GetListOfFunctions()->LastLink()
);
system
Closed
October 19, 2022, 12:03pm
10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.