Function not plotted

It should work. Do you have a small script reproducing this problem ?

Also, can you try to start root with option -n ie: root -n
It might be that you have something preventing the fit drawing inside your rootlogon.C.

Hi couet,
Thank you for quick response.
I have run the code root -n test.C, but of no help.

Here is full code:

  ifstream infile("test.txt");
  float x[10],y[10],z[10];
  int count =0;
      if(infile.eof()) continue;
  TGraph *gr = new TGraph(count, x,y);

And the test.txt file is:

10	537	2.861 
20	632.2	4.019
30	624.4	2.772
40	672.9	2.542
50	725.6	2.596



Sorry, Wile_E_Coyote. No help. Problem persists.

It is fine for me:

root [0] 
Processing srikanta.C...
10	537	2.861
20	632.2	4.019
30	624.4	2.772
40	672.9	2.542

Minimizer is Minuit / Migrad
Chi2                      =      1346.29
NDf                       =            1
Edm                       =  3.34285e-07
NCalls                    =          151
Constant                  =      665.551   +/-   43.5956     
Mean                      =      41.6061   +/-   25.3135     
Sigma                     =      50.3097   +/-   37.9442      	 (limited)
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [1] 

Hi couet,
It is working fine in other’s Ubuntu OS (16.04) as well, but not in my Ubuntu OS. I re-installed root using both methods, cmake and in binary, but it did not work.

Thanks any way.

Can it be that you have Ubuntu’s “system-provided” ROOT related packages installed?
Execute “sudo apt-get purge root-system* root-plugin* libroot*” (afterwards check that the “/usr/lib/i386-linux-gnu/root5.34” and the “/usr/lib/x86_64-linux-gnu/root5.34” subdirectories disappeared completely)

what do you get as terminal output when you run the macro ?

The same what you get and the graph as you have posted. Only fit function (red-curve) is not present.

Hi Wile_E_Coyote,
I executed the command and it removed files from /usr/lib/x86_64-linux-gnu/root5.34. Now re-run the code, but it did not help.

Thanks any way.

Can you save the canvas as a .root file and post it here ?

test.root (16.6 KB)
Hi couet,
Please find the file attached.

Your own ROOT is broken. After you removed the Ubuntu’s “system-provided” ROOT 5 related packages, you MUST configure and build your ROOT 5 completely from scratch again.

Yes your ROOT should be somehow broken.
The file you sent seems a bit weird.
Can you save the canvas as a .C and send it ?

test.C (2.8 KB)
Hi couet,
After following instructions as said by Wile_E_Coyote, I re-run the code and saved the macro. Please have a look.

Hi Wile_E_Coyote,
I followed the steps and found that from Prerequisites, libjpeg was not installed. So I did it and then I re plot it (unfortunately the problem remains same). Please find the root macro attached in a reply to couet.

Your “saved” macro is fine. When I run it I get the following picture:

and you can see in the code that the fit function is there.
So your root should have something wrong as Wile said.

configure.out.txt (8.0 KB)
make.out.txt (480.5 KB)

Hi Wile_E_Coyote,
I see some issues on one of output file (both attached here) which was created while following instructions as mentioned in your reply. Please have a look and let me know if I am making some mistakes.

From the “configure.out.txt”, I think you should at least install “libgsl-dev” and “python-dev”.

I cannot access “make.out.txt” (“page doesn’t exist or is private”).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.