How to draw a figure with a x axis and many subfigure with many y axis?

Like this:

X axis is date.

Thank you for your reply. I check TPad class and also tutorials/graph/zones.c. This divide method is basically draw many different figures together in one canvas. When I zoom in the x axis of the bottom subfigure the top figure will not change. It works but not convenient. What if I want all the figure can be arranged under one x axis and when I zoom in the x axis all subfigure will zoom together? Because my data is from 2016-01-01 to 2017-09-15 and each variable has one data point per hour so I have to zoom in to check a small time range frequently.

The attached macro does it but an extra click is needed on the bottom axis to propagate the zoom on the 2 top pads. Not sure why (yet).
zoomdiv.C (740 Bytes)

It works pretty good :grinning:. I think it will be very convenient for time-domain analysis if there is a class with Add() function like TMultigraph can easily achieve this. Also if I save the canvas in a ROOT file the zoom() method doesn’t work. Don’t know how to solve this.

yes it could be that the TExec does not go in the .root file.

Is there a better solution that works in .root file?

If you what to be able to zoom interactively you need to start from the macro. I do not think there is a better solution.

Thanks. That helps a lot :grin:.

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