Remove some axes of a TPad

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.

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. 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


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 ?

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 (53.2 KB)

I have a macro doing that sort of things. Here it is:
BrokenAxis.C (1.4 KB)

It produces:

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