Drawing axis of a TMultiGraph object

Hello fellow root-ers,

I am trying to generate a multi-pane graph consisting of TMultiGraph objects. Since there is no multi-pane graph object implemented in ROOT (as far as I know) I do it with a little trick - I draw the TMultiGraph object in different pads with very small margins so they appear to be sharing axes. In order to make sure I have same ranges for all axes I use function SetRangeUser(Double_t, Double_t). Everything works but sometimes the axis is drawn slightly differently - some tickmarks are shifted while others are at exactly same locations as before.

To get an idea what is going on and what it looks like I attached a gzipped tar file with a root file which contains 16 TMultiGraphs to be plotted, a script Plot16.C which does the plotting and an eps file with the result I get using root version 4.04. Notice the slight shifts of tickmarks for graphs labeled as “Al”, “F”, “Ne” but everything looks OK for “Ar”, “P”, “Si”. Is this a problem of the rendering (drawing) algorithm or is it something I am doing wrong?

thanks for help
michal
test.tar.gz (46.4 KB)

The macro you posted is not working. Rene had to make many modifications to make it work, then asked me to look at it to find out what was going wrong with the tick marks alignment. The attached macro does have the tick marks aligned. Basically you should add the two following lines in the loop on multigraphs:

    mg_list[i]->GetHistogram()->GetXaxis()->SetLimits(-5,15);
    mg_list[i]->GetHistogram()->GetXaxis()->SetRange(0,0);

The first line (SetLimits) ensure that all the TMultiGraphs have the same X axis limits. The second line ensure that there is no subranges (for some reason your TMultiGraphs have some)
Plot16.C (7.61 KB)