# A stupid example

    //This is a trivial example of a ROOT macro
    gROOT.Time
    h200.SetFillColor(2)
    h101.SetFillColor(5)
    TCanvas wh(wh,"Histogram Window",10,10,700,500)
    //TCanvas wh("","Histogram Window",10,10,700,500)
    ps.Open(test.ps)
    gStyle.SetFuncColor(4)
    gStyle.SetFuncWidth(6)
    wh.Range(0,0,20,20)
    wh.SetFillColor(18)
    wh.SetBorderMode(0)
    wh.Paint
    TPad p1(p1,p1,0.02,0.02,0.50,0.26,46,3,1)
    p1.Range(-1,-1,20,20)
    p1.Draw
    p1.cd
    TLine xaxis(2,2,18,2)
    TLine yaxis(2,2,2,18)
    xaxis.SetLineColor(2)
    xaxis.SetLineWidth(4)
    yaxis.SetLineColor(2)
    yaxis.SetLineWidth(4)
    xaxis.Draw
    yaxis.Draw
    TLine g1(3,3,6,6)
    g1.SetLineColor(5)
    g1.SetLineWidth(6)
    g1.Draw
    TLine g2(6,6,14,9)
    g2.SetLineColor(5)
    g2.SetLineWidth(6)
    g2.Draw
    TLine g3(14,9,19,18)
    g3.SetLineColor(5)
    g3.SetLineWidth(6)
    g3.Draw
    TText t1(3,16,"This is Pad P1")
    t1.SetTextColor(6)
    t1.SetTextSize(0.13)
    t1.SetTextAlign(12)
    t1.SetTextFont(62)
    t1.Draw
    TText v1(1.6,2,0)
    v1.SetTextColor(1)
    v1.SetTextAlign(32)
    v1.SetTextSize(0.08)
    v1.SetTextFont(62)
    v1.Draw
    v1.DrawText(1.6,4,2)
    v1.DrawText(1.6,6,4)
    v1.DrawText(1.6,8,6)
    v1.DrawText(1.6,10,8)
    v1.DrawText(1.6,12,10)
    v1.DrawText(1.6,14,12)
    v1.DrawText(1.6,16,14)
    v1.DrawText(1.6,18,16)
    TText v2(2,1.6,0)
    v2.SetTextColor(1)
    v2.SetTextAlign(23)
    v2.SetTextSize(0.08)
    v2.SetTextFont(62)
    v2.Draw
    v2.DrawText(4,1.6,2)
    v2.DrawText(6,1.6,4)
    v2.DrawText(8,1.6,6)
    v2.DrawText(10,1.6,8)
    v2.DrawText(12,1.6,10)
    v2.DrawText(14,1.6,12)
    v2.DrawText(16,1.6,14)
    v2.DrawText(18,1.6,16)
    TLine grid(2,6,18,6)
    grid.SetLineColor(2)
    grid.SetLineStyle(4)
    grid.Draw
    grid.DrawLine(2,10,18,10)
    grid.DrawLine(2,14,18,14)
    grid.DrawLine(2,18,18,18)

    //Here we start more interesting things
    wh.cd
    //
    //
    //
    <<Creating p2
    TPad p2(p2,p2,0.02,0.3,0.50,0.67,46,3,1)
    p2.SetGridx
    p2.SetGridy
    p2.Draw
    p2.cd
    h101.SetMarkerStyle(21)
    h101.SetMarkerSize(1)
    h101.Draw(e1p)
    wh.cd
    <<Creating p3
    TPad p3(p3,p3,0.53,0.02,0.46,0.95,25,3,1)
    p3.Draw
    p3.cd
    <<Creating p31
    TPad p31(p31,p31,0.05,0.02,0.9,0.45,43,3,1)
    p31.Draw
    p31.cd
    h104.SetFillColor(2)
    h104.SetFillStyle(3008)
    h104.Draw
    <<Creating p32
    p3.cd
    TPad p32(p32,p32,0.05,0.51,0.9,0.47,43,3,1)
    p32.Draw
    p32.cd
    p32.SetGridy
    h77.Draw(b)
    p2.cd
    ps.Close

[ROOT page] [Class index] [Top of the page]

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.