# Axis labels overlapped by pad

**URL:** <https://root-forum.cern.ch/t/axis-labels-overlapped-by-pad/6920>\
**Category:** ROOT\
**Created:** [July 30, 2008, 7:50pm UTC](https://root-forum.cern.ch/t/axis-labels-overlapped-by-pad/6920 "2008-07-30T19:50:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pwaller](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pwaller/32/11130_2.png) [@pwaller](https://root-forum.cern.ch/u/pwaller)\
**Post date:** [July 30, 2008, 7:50pm UTC](https://root-forum.cern.ch/t/axis-labels-overlapped-by-pad/6920/1 "2008-07-30T19:50:04Z")

</div>

When drawing two pads near each other, one pad can overlap the axis label of the other, which looks a little sloppy. Is there any way to avoid this? I have attached an example plot. On the left, the ‘0’ on the axis is cut in half. By itself, it doesn’t matter too greatly, but with many of these plots it is annoying!

Are there any workarounds short of opening it up in an EPS or SVG editor?

Cheers,

- Peter

```auto
def MakeDoublePlot(D, det, col = kRed):
    global p, l, c, leg
    c = TCanvas()
    c.Divide(1, 2)

    p = D.Clone("pull")
    p.Add( det, -1 )
    p.Divide( D )
    topSize = 0.7
    bottomSize = 0.3
    bottomOffset = 0

    p1 = c.cd(1)
    p1.SetPad("a","a", 0, 1 - topSize, 1, 1, kWhite, 0, 0)
    p1.SetTopMargin( 0.01 ); p1.SetBottomMargin( 0 ); p1.SetRightMargin( 0.01 )

    det.SetTickLength( 0.01 / topSize )
    det.GetYaxis().SetLabelSize( 0.04 / topSize )

    det.SetStats(0)
    det.SetTitle("")
    D.SetStats(0)
    D.SetTitle("")

    det.Draw("hist")
    D.Draw("same e1x0")

    p2 = c.cd(2)
    p2.SetPad("b","b", 0, bottomOffset, 1, bottomSize, kWhite, 0, 0)
    p2.SetTopMargin( 0 ); p2.SetBottomMargin( 0.3 ); p2.SetRightMargin( 0.01 )

    p.GetXaxis().SetLabelSize(0.04 / bottomSize); p.GetXaxis().SetNdivisions(510);
    p.GetYaxis().SetLabelSize(0.04 / bottomSize); p.GetYaxis().SetNdivisions(205);
    p.GetYaxis().SetTitle("Pull")
    p.GetXaxis().SetTitle( "cos #theta*" )
    p.GetXaxis().SetTitleSize( 0.04 / bottomSize )
    p.GetYaxis().SetTitleSize( 0.04 / bottomSize )
    p.GetYaxis().SetTitleOffset( 0.34 )
    p.GetYaxis().CenterTitle()

    p.SetTickLength( 0.01 / bottomSize )

    p.SetStats(0)
    p.SetTitle("")

    p.Draw("e1x0")
    l = TLine( -1, 0, 1, 0 )
    l.SetLineColor( col )
    l.Draw()
    p.Draw("e1x0 same")

    return c
```

 ![](https://root-forum.cern.ch/uploads/default/original/2X/f/f406470322f9d8837b1aed70e513120b60f99e27.png)

---

_[View the full topic](https://root-forum.cern.ch/t/axis-labels-overlapped-by-pad/6920)._
