Save a canvas into a macro .C problem


I have noticed that when I have a canvas with an histogram fitted by a TF1 function and I save it in the macro file format .C, the TF1 is not saved. To define my TF1, I am using a “C++ function”. Is it the normal behaviour, or did I do something wrong?

Thank you,


In this case, ROOT has no way to save the code of your C++ function. Instead it computes the values of the functions at the fNpx equidistant points. (this mainly for drawing purposes)


Ok thank you for your answer. I will just add manually my C++ function in the .C file.