Histogram 'c' interpolation type


I’m attempting to create a smooth histogram by calling the Draw(‘c’) option, but the default method causes small-scale fluctuations on my plot. Is there a way of telling the ‘c’ option to use a different interpolation type (ie. linear interpolation), or do I have to go about it a different way?


I think you might have to make your own interpolation function object and draw that on top of your histogram or graph. If you follow the example here: http://root.cern.ch/drupal/content/function-interpolation you can see how do to it manually.

I wrote my own class that inherits from ROOT::Math::Interpolator that also implements the right operators and methods in order to be able to feed a TF1 constructor. If you are interested you can find the code here: http://bazaar.launchpad.net/~jfcaron/+junk/Proto2BeamTest2/view/head:/t2x.C The relevant parts are the class “MyInterpolator” at line 47, the function “makeTF1” (line 321) and “makeTGraph” (line 351) that take a MyInterpolator * argument.


The C option is just a way to draw and curve in a smother way. You should not use it as tool to fit or smooth a data set. The Fit() method is the way to do it.

see also