void example1(){ //coordiantes of first pavelabel float x1_1=0.2; float x2_1=0.3; float y1_1=0.2; float y2_1=0.3; //coordinates of second pavelabel float x1_2=0.7; float x2_2=0.8; float y1_2=0.7; float y2_2=0.8; //create and draw the pavelabels TPaveLabel *label1 = new TPaveLabel(x1_1, y1_1, x2_1, y2_1, "label 1"); TPaveLabel *label2 = new TPaveLabel(x1_2, y1_2, x2_2, y2_2, "second label"); label1->Draw(); label2->Draw(); // draw a line connecting them TLine *line = new TLine(x2_1, y2_1, x1_2, y1_2); line->Draw(); } void example2(){ //coordinates of first text box float x_1=0.2; float y_1=0.2; //coordinates of second text box float x_2=0.7; float y_2=0.7; TText *text1 = new TText(x_1, y_1, "label 1"); TText *text2 = new TText(x_2, y_2, "second label"); //draw them text1->Draw(); text2->Draw(); // guess at size of box TBox *box1 = new TBox(x_1, y_1, x_1+0.1, y_1+0.1); box1->SetFillStyle(0); box1->Draw(); TBox *box2 = new TBox(x_2, y_2, x_2+0.1, y_2+0.1); box2->SetFillStyle(0); box2->Draw(); //connect them TLine *line = new TLine(x_1+0.1, y_1+0.1, x_2, y_2); line->Draw(); }