Place histogram at given point in a canvas

Hi,
how do I place one or sevaral histograms at a given point in a canvas? What do I have to do replace the TBox in this example with a histogram?

  c = new TCanvas("c","c",400,400);
  c->Range(-283,-714,108,204);
  b = new TBox(-100,-300,100,100);
  b->Draw()

I guess, that I have to create a new TPad, but I don’t know how to calculate the coordinates.

Cheers, J.

see example below

Rene

[code]{
TCanvas *c1 = new TCanvas(“c1”, “c1”,14,30,700,530);

// ------------>create a new pad p1
// pad coordinates are expressed in NDC [0,1] with respect to parent pad
TPad *p1 = new TPad(“p1”, “newpad”,0.07,0.58,0.40,0.86);
p1->Draw();
p1->cd();
//define a range and create a low level primitive
p1->Range(-10,0,20,5);
TBox *box = new TBox(-6,1,18,4);
box->SetFillColor(kOrange);
box->Draw();
c1->cd();

// ------------>create another pad p2
TPad *p2 = new TPad(“p2”, “newpad”,0.2658046,0.06991525,0.9166667,0.4872881);
p2->Draw();
p2->cd();
//when drawing the TF1 object, it will automatically compute
// the user coordinate range
TF1 *f = new TF1(“f”,“sin(x)/x”,0,10);
f->Draw();
}
[/code]

My problem seems to be, that I don’t know where to place the new Pad, if I want to place it at known user coordinates. Can I give the coordinates of a new TPad in user coordinates, or which method of the canvas converts user coordinates to NDC coordinates?

To convert from user coordinates (x,y) in pad, do

double u = (x-pad->GetX1())/(pad->GetX2()-pad->GetX1()); double v = (y-pad->GetY1())/(pad->GetY2()-pad->GetY1());
Rene

This looks a little bit circuitously to me, but seems to be exactly what I need.
Thanks.