Changing the y axis range in a TH1F in root

  • Thread starter Thread starter lavster
  • Start date Start date
  • Tags Tags
    Axis Range Root
Click For Summary
SUMMARY

The discussion focuses on modifying the y-axis range of a TH1F histogram in ROOT to display the normalized number of entries per bin instead of the raw counts. Users are advised to utilize the "DrawNormalized" method to achieve this functionality. The official ROOT documentation can be accessed at http://root.cern.ch/root/html/TH1.html for further reference on class methods. This approach ensures that the histogram accurately reflects the proportion of entries relative to the total count.

PREREQUISITES
  • Familiarity with ROOT framework and TH1F class
  • Understanding of histogram normalization techniques
  • Basic knowledge of C++ programming
  • Ability to navigate online documentation and resources
NEXT STEPS
  • Research the "DrawNormalized" method in ROOT for histogram normalization
  • Explore additional TH1F member functions for advanced histogram manipulation
  • Learn about histogram scaling and binning strategies in ROOT
  • Review examples of data visualization using ROOT for practical applications
USEFUL FOR

Data scientists, physicists, and researchers utilizing ROOT for data visualization and analysis, particularly those interested in histogram normalization techniques.

lavster
Messages
213
Reaction score
0
hi, I am plotting a 1D graph in root (TH1F pointer). currently the y-axis gives the number of entries in each bin along my x-axis. how do i change it so that it is actually the number of entries in each bin divided by the total number of entries.

thanks
 
Technology news on Phys.org
I cannot answer your question but from my experience with root: Get to the online description of the classes and look for a suitable member. The description would be here http://root.cern.ch/root/html/TH1.html but I usually just google for "root cern <classname>". In your particular example, I'd try the methods involving something like "normalize", e.g. "DrawNormalized".
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 17 ·
Replies
17
Views
4K
Replies
3
Views
5K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
7K
  • · Replies 37 ·
2
Replies
37
Views
5K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
22
Views
5K