TLatex latex; latex.SetTextAngle(45); latex.DrawLatex(0.5,0.5,"Rotated Text");
void drawRotatedText(){ TLatex latex; latex.SetNDC(); latex.SetTextAngle(30); latex.DrawLatex(0.3,0.3,"This is some rotated text"); }In this example, a function called "drawRotatedText" is defined which creates a TLatex object and sets the text angle to 30 degrees. The text "This is some rotated text" is then written on the canvas at position (0.3,0.3) as a rotated text. The SetNDC function is used to set the normalization for the canvas so the text will scale properly. Package library used for this function is ROOT (CERN's data analysis framework).