Getting 1D histos from 2D histo

I know that a TProfile can give me information such as mean and RMS for each x-bin of a 2D histogram,
but is there a quick way to print the actual histogram of the events in each bin ?


I’ve found the answer to my question in this post:

I have another question related to this topic.

I see that FitSlicesY has the option:

“N” means do not show the result of the fit

but it’s not clear to me where the fit result should be shown when I don’t choose this option (I’d like to see the histogram and its fit for each x bin)

Normally, the fitted function is attached to the histogram you’re fitting, so when it is drawn, the function is drawn with it. When you use the “N” option, this is not done - useful when you want to get the fit values, but not the visual representation.

This is based on the TH1::Fit() documentation, but I expect the fit slices (which generates a list of histograms) to follow the same logic. See … 3ca47dabdd

Right, but I don’t get the fitted histogram as output anywhere when I remove the “N” option, so I’m wondering where they should appear.

Can you post a simple macro reproducing your problem ?