# Remove some axes of a TPad

**URL:** <https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718>\
**Category:** ROOT\
**Tags:** graphics\
**Created:** [September 18, 2018, 8:10pm UTC](https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718 "2018-09-18T20:10:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heshy\_Roskes](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/8c91f0/32.png) [@Heshy\_Roskes](https://root-forum.cern.ch/u/Heshy_Roskes)\
**Post date:** [September 18, 2018, 8:10pm UTC](https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718/1 "2018-09-18T20:10:26Z")

</div>

Dear experts,

I’d like to remove some of the axes from some pads in a TCanvas. The plot in question was made public by CMS yesterday, and you can find it [here](http://cds.cern.ch/record/2638605/files/Figure_004-a.pdf?version=1).

In this plot, the x axis goes from -1 to 1 and the y axis goes from 0 to 250. We divide the canvas into 6 pads, by breaking the x axis at +/-0.05 and the y axis at 11. This lets us zoom into the interesting region around (0, 0) while still keeping the shape of the rest of the plot visible.

Since the likelihood curves never cross the vertical boundaries in the upper half of the plot, we remove these boundaries so that the legend, which is drawn directly on the canvas, can span the whole top half, instead of being squeezed into the empty top middle pad. We did this by manually editing the PDF file, but for the future we’d like to find a way to do this from within ROOT.

To be more explicit, we want to get rid of

- the right side y axis of the top left pad
- both y axes of the top middle pad
- the left side y axis of the top right pad

We don’t just want to remove the labels and tick marks, as in [this thread](https://root-forum.cern.ch/t/removing-only-x-axis-from-a-histogram/4934). We want the entire axes to be gone, or at least invisible.

Is this possible?

If it makes a difference, the things being drawn here are TMultiGraphs. We create one with all four graphs, clone it 5 times, and draw one on each pad using Draw(“AP”).

Thanks in advance,

Heshy

* * *

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 19, 2018, 6:44am UTC](https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718/2 "2018-09-19T06:44:49Z")

</div>

> [@Heshy\_Roskes](#):
>
> We don’t just want to remove the labels and tick marks, as in [this thread](https://root-forum.cern.ch/t/removing-only-x-axis-from-a-histogram/4934). We want the entire axes to be gone, or at least invisible.

If you remove the ticks and the labels there is not a lot left visible … The first link you provided is broken. I can not see the picture you are talking about. Do you have a macro reproducing what you have now ?

---

<div class="post-metadata">

**Author:** ![Heshy\_Roskes](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/8c91f0/32.png) [@Heshy\_Roskes](https://root-forum.cern.ch/u/Heshy_Roskes)\
**Post date:** [September 20, 2018, 1:20pm UTC](https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718/3 "2018-09-20T13:20:27Z")

</div>

The point is I don’t want black lines separating the pads in the top half of the canvas. The link is working for me, even in incognito so I’m sure it doesn’t need any login, but I also attached the picture below.

[Figure\_004-a.pdf](https://root-forum.cern.ch/uploads/default/original/3X/0/1/01b9e46e37074711d09d28331738e6c417bae7db.pdf) (53.2 KB)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 20, 2018, 2:34pm UTC](https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718/4 "2018-09-20T14:34:46Z")

</div>

I have a macro doing that sort of things. Here it is:  
[BrokenAxis.C](https://root-forum.cern.ch/uploads/default/original/2X/b/bc405a9771d482382782ba1131524e76158e140a.C) (1.4 KB)

It produces:

 ![17](https://root-forum.cern.ch/uploads/default/original/3X/7/1/71c4431a87c034fcc8905b72e9f089e123bd1a55.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 4, 2018, 2:34pm UTC](https://root-forum.cern.ch/t/remove-some-axes-of-a-tpad/30718/5 "2018-10-04T14:34:49Z")

</div>

Closed on October 4, 2018, 2:34pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
