How to made a left and a right independent axis


I want to draw two graphs in one multigraph, in which the x axis is the same,
but y axes are different, and I hope one is at the left the other at the right. One more important thing is that when I set one as “log”, the curve related to this axis will change but the other not, how can I do that?


also this option Y+ in : … nter:Paint

also this option Y+ in : … nter:Paint[/quote]

Yes, it works to some extent, :smiley:. But in this case, the draw object is TGraphes not histograms, and even though in histograms, the right axis can not be changed to “log” scale independently. What I can do is just to rescale
the axis of the canvas, but not that of the histogram. In addition, for only several data points in the curve, I prefer the graph to the histogram.

DoubleAxies.cxx (2.55 KB)

Here is a modified version of your macro. I tried to make it the closest possible to what I understood you are looking for…
DoubleAxies.cxx (1.77 KB)

Yes, couet, you are right, when I create two pads to draw the graphes and
use options"Y+X+", I can make a good result. There is still a pity that after
drawing the “pad2”, “pad1” will not be edited by mouse in the “Editor”.

Thank you very much!

DoubleAxies_R1.cxx (2.26 KB)

that’s normal. There is now 2 pad covering each other. You access the one on top.