def myLineBoxTextBorder(x, y, lcolor, lstyle, bcolor, bstyle, bsize, tsize, text): l = TLatex() l.SetTextAlign(12) l.SetTextSize(tsize/2.5) l.SetNDC() l.DrawLatex(x,y,text) yl1 = y-0.25*bsize yl2 = y+0.25*bsize xl1 = x-0.25*bsize-0.4*bsize xl2 = x+0.25*bsize-0.4*bsize #print("line = ",xl1,yl1,xl2,yl2) mline = TLine(xl1,yl1,xl2,yl2) mline.SetLineColor(lcolor) mline.SetLineStyle(lstyle) mline.SetLineWidth(2) y_new=(yl1+yl2)/2. mline.DrawLineNDC(xl1,y_new,xl2,y_new) yb1 = y-0.15*bsize yb2 = y+0.15*bsize xb1 = x-0.25*bsize-0.4*bsize xb2 = x+0.25*bsize-0.4*bsize #print("box = ",xb1,yb1,xb2,yb2) mbox = TPave(xb1,yb1,xb2,yb2,1,"NDC") mbox.SetLineWidth(2) mbox.SetLineColor(1) mbox.SetFillColor(bcolor) mbox.SetFillStyle(bstyle) mbox.Draw("l") return mbox
def myMarkerTextSmall2(x, y, lcolor, lstyle, mcolor, mstyle, msize, size, text): l = TLatex() l.SetTextAlign(12) l.SetTextSize(size / 2.5) l.SetNDC() l.DrawLatex(x, y, text) yb1 = y - 0.15 * size yb2 = y + 0.15 * size xb1 = x - 0.28 * size - 0.45 * size xb2 = x + 0.28 * size - 0.45 * size print "box = ", xb1, yb1, xb2, yb2 #print "line = ",xl1,yl1,xl2,yl2 mline1 = TLine(xb1, yb1, xb2, yb2) mline1.SetLineColor(lcolor) mline1.SetLineStyle(lstyle) mline1.SetLineWidth(2) y_new = (yb1 + yb2) / 2. mline1.DrawLineNDC(xb1, y_new, xb2, y_new) mline2 = TLine(xb1, yb1, xb2, yb2) mline2.SetLineColor(lcolor) mline2.SetLineStyle(lstyle) mline2.SetLineWidth(2) x_new = (xb1 + xb2) / 2. mline2.DrawLineNDC(x_new, yb1, x_new, yb2) marker = TMarker((xb1 + xb2) / 2.0, y, mstyle) marker.SetNDC() marker.SetMarkerColor(mcolor) marker.SetMarkerStyle(mstyle) marker.SetMarkerSize(msize) marker.Draw() return marker
def myLineText(x, y, lsize, lcolor, lstyle, tsize, text): l = TLatex() l.SetTextAlign(12) l.SetTextSize(tsize) l.SetNDC() l.DrawLatex(x,y,text) y1 = y-0.25*lsize y2 = y+0.25*lsize x2 = x-0.3*lsize x1 = x2-lsize mline = TLine() mline.SetLineWidth(2) mline.SetLineColor(lcolor) mline.SetLineStyle(lstyle) y_new=(y1+y2)/2. mline.DrawLineNDC(x1,y_new,x2,y_new)
def myBoxText(x,y,boxsize,mcolor,text): tsize=0.06; l=TLatex(); l.SetTextAlign(12); l.SetNDC(); l.DrawLatex(x,y,text); y1=y-0.25*tsize; y2=y+0.25*tsize; x2=x-0.3*tsize; x1=x2-boxsize; mbox= TPave(x1,y1,x2,y2,0,"NDC"); mbox.SetFillColor(mcolor); mbox.SetFillStyle(1001); mbox.Draw(); mline=TLine() mline.SetLineWidth(4) mline.SetLineColor(1) mline.SetLineStyle(1) y=(y1+y2)/2. mline.DrawLineNDC(x1,y,x2,y)
def myBoxText(x, y, boxsize, mcolor, text, tsize=0.06): l = TLatex() l.SetTextAlign(12) l.SetTextSize(tsize) l.SetNDC() l.DrawLatex(x, y, text) y1 = y - 0.25 * tsize y2 = y + 0.25 * tsize x2 = x - 0.3 * tsize x1 = x2 - boxsize mbox = TPave(x1, y1, x2, y2, 0, "NDC") mbox.SetFillColor(mcolor) mbox.SetFillStyle(1001) mbox.Draw() mline = TLine() mline.SetLineWidth(8) mline.SetLineColor(mcolor) mline.SetLineStyle(1) y = (y1 + y2) / 2. mline.DrawLineNDC(x1, y, x2, y)