Alkass
June 30, 2015, 9:39am
1
Hi
After filling a TCanvas,
TCanvas *c1= new TCanvas("c1","stacked hists",600,600);
c1->Divide(3,3);
for (int i=0;i<CutN;i++){
sprintf(tt,"%s%i","mutau/met_MT_",i);
hmet_MT[i] = (TH2D*) file->Get(tt);
c1->cd(i+1);hmet_MT[i]->Draw("colz");
}
c1->Update();
c1->SaveAs("met_MT_"+fileName+".png");
The problem is that the TCanvas is not saved properly
but while running the code, the canvas that pops up is split properly…
thanks in advance
1 Like
I think this is the same bug as reported here:
I am able to reproduce this problem on my Ubuntu 14.04.
It is related to two lines in the “rootlogon.C”:
gStyle->SetCanvasDefH(RequestedH);
gStyle->SetCanvasDefW(RequestedW);
As soon as “RequestedH” and/or “RequestedW” exceed physical dimensions of my screen, I also get “spurious” contents in the “bottom” and/or “right” side in the “test1.png” file (but not in another saved pictures and not on the screen).
I can clearly see that, when the “png_double_x_axis_title” macro starts, ROOT opens a…
Alkass
June 30, 2015, 9:48am
3
Ok, thanks
So, temporarily, what is working for me is to just execute my script with the “-b” flag as well ie
root -l script.C -b
so in the silent mode actually my canvases are save in the dimensions and are filled properly if I open them afterwards.
Regards
couet
September 14, 2017, 10:55am
4
As the problem Wile refer to has been fixed this one (according to him) might be fixed toot. Unfortunately I cannot try it because the macro posted at the top cannot be executed.