void getPads(int npad, int nxpad, int nypad, TPad** padPtrs) { double xlow, xhigh, ylow, yhigh; double plotFrac = 0.95; int row = 1; int col = 0; for (int i = 0; i < npad; i++) { col++; if (col > nxpad) {row++; col = 1;} xlow = (double)(col - 1)/nxpad; xhigh = (double)col/nxpad; ylow = (double)(nypad - row)/nypad; ylow *= plotFrac; yhigh = (double)(nypad - row + 1)/nypad; yhigh *= plotFrac; padPtrs[i] = new TPad("padName", "padTitle", xlow, ylow, xhigh, yhigh); padPtrs[i]->Draw(); } padPtrs[npad] = new TPad("titlePad", "titlePadTitle", 0.0, plotFrac, 1.0, 1.0); padPtrs[npad]->Draw(); }