Draw RooFit pdfs

I have a fitted RooFit pdf that I want to overlay on a stacked histogram. Is there anyway to draw pdf outside of RooFit frames? Alternatively can a frame accept a stacked histogram and plot it without changing its style?


Hi @sciencecw


You can then always Draw(“same”) the histogram.



I guess the solution is 1) make histogram from pdf as you suggest
2) Draw using option “L” or “C” so it draws a line through bin centers instead of zig-zag


Seeing that a function seems to be better for you case, there is also asTF. See here:

This doesn’t have the right normalization. I wonder if this information is in the pdf at all? How does the RooFit frame work out the normalization?

All PDFs are normalised to unity. That’s, in fact, the definition of a PDF.

When you start to draw a PDF and the histogram contains a dataset, RooFit automatically scales the PDF to the number of data events in the histogram. See here:

You indeed would have to scale the TF1 to the number of data events in your frame.

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