Resizing pads created with c1->Divide(Nx,Ny)

I like to use c1->Divide(Nx,Ny) to divide canvasses for plotting many graphs on a canvas. Is there any way to control the aspect ratio or re-size pads created in this process? It is trivial to re-size pads with a mouse interactively - how can you do this in a script? I suppose one could do it be creating each pad by hand with TPad commands, but that is too tedious to contemplate.

use
TPad::SetPad(Double_t xlow, Double_t ylow, Double_t xup, Double_t yup);

Rene

Thanks for the information. I’ve attached a little routine for changing the aspect ratio of a pad. I think it would be nice to have such a routine as a TPad method.
SetAspect.C (1022 Bytes)

I tested your new function thanks to the attached macro. It seems to works fine except for the case ratio=1. In case of ratio = 1 I expected to get a square ? shouldn’t I ?
TestSetAspect.C (1.51 KB)

You are right,- the routine does not work in general because it works with canvas relative coordinates and not absolute screen coordinates. I have not figured out how switch to absolute coordinates. I’ve been trying XYtoAbsPixel to switch to pixel coordinates, but so far it has not worked. Unforunately, the documentation I’ve found (class index) is rather sparse so I don’t know quite what I’m doing and am working a bit by trial and error.

I do not think that’s a problem with XYtoAbsPixel. I just mentionned the fact that when I tried to have a square pad settting the aspect ratio to 1, I do not get a square. It works for all other cases so I guess it should also for that case.