Re: Adding a Pad into a Canvas

From: Patrick Decowski (decowski@mit.edu)
Date: Wed Oct 20 1999 - 14:54:08 MEST


hi anton,

On Wed, 20 Oct 1999 KOSU_FOKIN@garbo.lucas.lu.se wrote:

> Hello rooters,
> 
> How can I add a (Sub)Pad into a Canvas? If I have
> Canvas->Divide(2,2) and then I call Canvas->Divide(3,2) 
> to add a new (Sub)Pad, I did not get what I want.
> 
> I think I am missing something trivial.
> 

try this to have a canvas with different sub-subpads:

  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   2.23/04   14 October 1999   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

CINT/ROOT C/C++ Interpreter version 5.14.18, Oct 3 1999
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
Private parts loaded...
root [0] TCanvas c("c");               
root [1] c->Divide(2, 2);              
root [2] c->cd(1);                     
root [3] gPad->Divide(3, 2); //
root [4] TH1F h("ada", "ada", 10, 0, 1);
root [5] gPad->cd(1);
root [6] h.Draw();
root [7] TPad *first = (TPad*)c->GetPrimitive("c_1");
root [8] first->cd(); //back to first pad in canvas
root [9] 

cheers,
patrick.

-------------------------------------------o-------------------------------
Patrick Decowski                           |
24-504                                     |    Home:      (617)625-9352
Massachusetts Institute of Technology      |    Office:    (617)253-9735
77 Massachusetts Ave                       |    Fax:       (617)253-1755
Cambridge, MA 02139-4307                   |
-------------------------------------------o-------------------------------
http://web.mit.edu/decowski/www/home.html  |    e-mail: decowski@mit.edu
-------------------------------------------o-------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:41 MET