I was going through the tutorials for RooFit on PyROOT, and most of them contain the syntax that looks like the one below(line 68 of fitting composite pdf tutorial is an example of such):
df.plotOn(frame, LineColor="kRed")
I found the above syntax in (ROOT: Arguments for plotOn functions).
But when I run the syntax, I get the following error:
TypeError Traceback (most recent call last)
<ipython-input-8-f62f79d4f25f> in <module>
----> 1 data.plotOn(frame, LineColor="kRed")
TypeError: none of the 2 overloaded methods succeeded. Full details:
RooPlot* RooAbsData::plotOn(RooPlot* frame, const RooLinkedList& cmdList) =>
TypeError: RooAbsData::plotOn got an unexpected keyword argument 'LineColor'
RooPlot* RooAbsData::plotOn(RooPlot* frame, const RooCmdArg& arg1 = RooCmdArg::none(), const RooCmdArg& arg2 = RooCmdArg::none(), const RooCmdArg& arg3 = RooCmdArg::none(), const RooCmdArg& arg4 = RooCmdArg::none(), const RooCmdArg& arg5 = RooCmdArg::none(), const RooCmdArg& arg6 = RooCmdArg::none(), const RooCmdArg& arg7 = RooCmdArg::none(), const RooCmdArg& arg8 = RooCmdArg::none()) =>
TypeError: RooAbsData::plotOn got an unexpected keyword argument 'LineColor'
most importantly,
TypeError: RooAbsData::plotOn got an unexpected keyword argument 'LineColor'
I tried doing the following things:
from ROOT import * \\ same error as above
from ROOT.RooFit import * \\ same error as above
data.plotOn(frame, RooFit.LineColor="kRed") \\ SyntaxError
data.plotOn(frame, RooFit.LineColor("kRed")) \\ TypeError
none of the above worked. But the one below works like a charm:
data.plotOn(frame, RooFit.LineColor(ROOT.kRed)) \\ Works!!
I just wanted to share my snippets.
Also, wanted to ask the experts whether this is just a version problem, a Jupyter notebook problem, or anything else.
Thanks, and welcome!
ROOT Version: JupyROOT 6.24/00
Platform: CentOS Linux release 7.9.2009 (Core)
Compiler: Python 3.8.8