Hello, first time poster here. Sorry if anything in my post goes against the guidelines, i’ve done my best to follow them .
I have a macro that draws a bunch of histograms/legends/etc. onto single-pad canvases. It does this very well and i’m very happy with it.
Now i’m interested in seeing some of of the hists/ratios on a multi-pad canvas, basically like this. I’d like to use my already-drawn canvases to do this. The following code works and gets me started.
TCanvas* canv_test= new TCanvas("canv_test", "", 2100,1500);
canv_test->cd();
TPad* pad_spectra = new TPad("pad_spectra", "Overlay Pad", 0.0, 0.30, 1.0, 1.0);
TPad* pad_ratio = new TPad("pad_ratio" , "Ratio Pad", 0.0, 0.00, 1.0, 0.30);
canv_test->cd();
pad_spectra->Draw();
pad_ratio->Draw();
pad_spectra->cd();
pad_spectra=(TPad*)already_drawn_spectra_canv->DrawClonePad();
pad_ratio->cd();
pad_ratio=(TPad*)already_drawn_ratio_canv->DrawClonePad();
So, i’d like the axis on the spectra plot covered by the ratio plot; like the example linked to above. Currently, the way canv_test looks, is there is space left between the bottom pad and the top pad; such that the title of already_drawn_ratio_canv and the axis title of already_drawn_spectra_canv are both clearly visible. I figure i can just adjust the contents of pad_spectra and pad_ratio to do what i need to do after DrawClonePad(), but my code instantly segfaults the second i try to adjust the margins on the pads. Forget calling pad->Update() or pad->Modified() after adjusting, pad->SetBottomMargin() is the line that crashes everything.
technical details;
ROOT Version: 6.02/13
Platform: Scientific Linux 6
Compiler: GCC 4.9.1