I have a canvas on which I have drawn a histogram. I have then fitted my histogram with a predefined function. I would now like to save the result to a .gif file. However, the fit is not shown.
Here’s a snippet of the code I used:
auto controlCanvas(new TCanvas("ControlCanvas", "Distributions", 20, 10, 600, 800));
Am I doing anything wrong?
P.S. I’m using ROOT in compiled mode.
try to use TCanvas::SaveAs() instead of print.
I tried this macro and for me SaveAs works fine.
TCanvas * controlCanvas=new TCanvas("ControlCanvas", "Distributions", 20, 10, 600, 800);
TH1D *hist = new TH1D("","",100,-1,1);
Can be that your parentheses at the first line are not right?
Everything seems right to me…
You used a TH1D while I used a TH1F, maybe the problem’s there.
But it would be quite strange if that were the case.
Also, I’m wrapping my histograms in STL smart pointers. Don’t know whether that can be harmful, though.
If you tried also with my macro and doesn’t work, you should wait for someone more expert than me.
I don’t know if the STL smart pointer can be the problem.
And I don’t think the TH1F is the problem I usually use TH1D just to avoid approximation problems.
Your macro works fine on my machine. I really have no idea.
Can you post a macro we can run reproducing the problem ?