I have divided a Canvas into 8 pads and draw histograms on them.
Now I want to expand X axes of ALL pads when I expand any X axis
on any pad using cursor.
Please find the attached file which I use to draw the histograms.
Thanks for the suggestion. According to your suggestion, I have to create a macro with
and loop over all drawn spectra. I can do that.
But that is not what I am looking for. How easy or difficult it is to do this with mouse?
i.e. as explained in earlier posts: to expand all the drawn spectra when any one spectra is
expanded using mouse.
You can use signal / slot
here is an example (not finished) … I have some more urgent matters to look at now. I can look at it again later but this daft gives an idea.
It worked for me. The idea is to use the signal slot mechanism to perform an action when an event occurs. In the macro SlotAxisChanged() you zoom all the other histograms according to the one you changed. As I said I have not investigated deeply but it might be that you may enter an infinite loop as the macro executed on the event RangeAxisChanged(0 will also generate RangeAxisChanged() events… At the end it might be easier to simply zoom using a macro as I first suggested.
Could you please post the version of the macro that worked for you.
In the earlier version of the macro I don’t see anything corresponding to “RangeAxisChanged()”.
Is the “RangeAxisChanged()” globally defined in the root libraries?
I tried running it on my Linux machine with 2.6.9-89.35.1.EL kernel with ROOT 5.30/00 exactly the same way you have suggested. This resulted in the error:
Now the macro doesn’t crash. However, it still doesn’t give the effect that I am looking for.
I remember that you said it is yet to be completed. When you get some time, could you please
complete it? I am not very much familiar with all the features of the ROOT. Therefore, I am not able to take it further.
Meanwhile, could you please suggest me how to proceed? I understand that when we expand X axis using mouse it gives “xmin” and “xmax”. How to use them further to redraw all the histograms with that range?