Histogram within a histogram

I would like to plot a histogram, and then overlay a smaller histogram with its own axes etc. in the same plot. I am thinking about a small chisq plot in one of the corners of a larger plot where two distributions are compared. Is this possible?


see example below


{ TCanvas *c1 = new TCanvas("c1"); TH1F *h1 = new TH1F("h1","test2",100,-3,3); h1->FillRandom("gaus",10000); TH1F *h2 = new TH1F("h2","test2",20,-2,4); h2->FillRandom("gaus",100); h1->Draw(); TPad *pad = new TPad("pad","test",0.12,0.55,0.45,0.88); pad->Draw(); pad->cd(); h2->Draw(); c1->cd(); }