Esempio n. 1
0
def createPaveLabel(x1, y1, x2, y2, text,
                    fillColor=1, textColor=0,
                    textSize=None):

    label = TPaveLabel(0.80, 0.80, 0.97, 0.88,
                           'Peak Fit')
    label.SetFillColor(fillColor)
    label.SetTextColor(textColor)
    label.SetTextFont(52)
    if (textSize != None):
        label.SetTextSize(textSize)

    label.Draw()
    return label
Esempio n. 2
0
    jbessel.SetLineStyle(1)
    jbessel.SetLineWidth(3)
    jbessel.SetLineColor(nu + 1)
    JBessel.append(jbessel)

# Setting x axis for JBessel
xaxis = JBessel[0].GetXaxis()
xaxis.SetTitle("x")
xaxis.SetTitleSize(0.06)
xaxis.SetTitleOffset(.7)

# setting the title in a label style
p1 = TPaveLabel(.0, .90, .0 + .50, .90 + .10, "Bessel J functions", "NDC")
p1.SetFillColor(0)
p1.SetTextFont(22)
p1.SetTextColor(kBlack)

# setting the legend
leg.AddEntry(JBessel[0].DrawCopy(), " J_0(x)", "l")
leg.AddEntry(JBessel[1].DrawCopy("same"), " J_1(x)", "l")
leg.AddEntry(JBessel[2].DrawCopy("same"), " J_2(x)", "l")
leg.AddEntry(JBessel[3].DrawCopy("same"), " J_3(x)", "l")
leg.AddEntry(JBessel[4].DrawCopy("same"), " J_4(x)", "l")

leg.Draw()
p1.Draw()

# Set canvas 2
DistCanvas.cd(2)
gPad.SetGrid()
gPad.SetFrameFillColor(19)