Hello rooters,
I take a canvas AllCanvas, divide it into 12 subcanvas and paint several graphs and histograms into these subcanvas. Then I would like to get one
graph or histogram out and draw it into a new TCanvas, which does not work properly.
My code:
TCanvas* AllCanvas = new TCanvas(“AllCanvas”,“All plots”, 50, 10, 1400,700);
AllCanvas->Divide(6,2);
AllCanvas->cd(1);
GT0_Rayleight->Draw(“A*”);
AllCanvas->cd(2);
GLineChiSquare->Draw(“C”);
… up to …
AllCanvas->cd(12);
HH->Draw();
That works. Then:
TCanvas Ctest =new TCanvas(“Ctest”,“Ctest”,10,20,600,400);
TPad SelectedCanvas;
SelectedCanvas=(TPad*)((TPad*)AllCanvas->GetPad(CanvNumb))->Clone());
where CanvNumb is between 1 and 12. When I now want to draw this SelectedCanvas:
Ctest->cd(0);
SelectedCanvas->Draw();
then it keeps the size of the original subcanvas and I have to resize it with the mouse. Is it possible to do this automatically?