コード例 #1
0
ファイル: AtlasStyle.py プロジェクト: JacobRawling/ATLASStyle
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
コード例 #2
0
c = TCanvas()

g_width.Draw('AC')
g_width.SetLineWidth(2)
g_width.SetTitle('hMSSM, m_{{A}} = {mass} GeV'.format(mass=int(mass)))

l_5percent.SetLineColor(2)
l_5percent.SetLineWidth(3)
l_10percent.SetLineColor(2)
l_10percent.SetLineWidth(3)
l_10percent.SetLineStyle(2)
l_25percent.SetLineColor(2)
l_25percent.SetLineStyle(3)
l_25percent.SetLineWidth(3)

p_5percent.SetMarkerStyle(20)
p_5percent.SetMarkerColor(2)
p_10percent.SetMarkerStyle(21)
p_10percent.SetMarkerColor(2)
p_25percent.SetMarkerStyle(22)
p_25percent.SetMarkerColor(2)

p_5percent.Draw()
l_5percent.Draw()
p_10percent.Draw()
l_10percent.Draw()
p_25percent.Draw()
l_25percent.Draw()

g_width.GetXaxis().SetTitle('1/tan(#beta)^{2}')  #  #prop coupling^{2}
g_width.GetYaxis().SetTitle('Width (GeV)')