TLatex* latex = new TLatex(); latex->SetLineWidth(2); latex->DrawLatex(0.5, 0.5, "x^2 + y^2 = r^2");
for(int i = 1; i <= 5; i++) { double lineWidth = i * 0.5; // set line width according to iteration TLatex* latex = new TLatex(); latex->SetLineWidth(lineWidth); latex->DrawLatex(i / 10.0, i / 10.0, "i=" + std::to_string(i)); }In this example, a loop is used to create five TLatex objects, each with a different line width. The line width is determined by the iteration variable i, and is set using SetLineWidth(). Package Library: ROOT (C++ data analysis framework)