# How to extract data from histogram

**URL:** <https://root-forum.cern.ch/t/how-to-extract-data-from-histogram/50894>\
**Category:** Newbie\
**Tags:** hist, root\
**Created:** [July 21, 2022, 9:38am UTC](https://root-forum.cern.ch/t/how-to-extract-data-from-histogram/50894 "2022-07-21T09:38:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eyvaz](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eyvaz/32/18740_2.png) [@Eyvaz](https://root-forum.cern.ch/u/Eyvaz)\
**Post date:** [July 21, 2022, 9:38am UTC](https://root-forum.cern.ch/t/how-to-extract-data-from-histogram/50894/1 "2022-07-21T09:38:51Z")

</div>

Hi experts, I am looking for extracting data from histogram  
I created histogram by using random numbers…

Best regards

[CDF\_77\_33cpp](https://root-forum.cern.ch/uploads/short-url/7MfTcPInBubs2iZHBND02khAQhk.cpp) (1.5 KB)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [July 21, 2022, 9:49am UTC](https://root-forum.cern.ch/t/how-to-extract-data-from-histogram/50894/2 "2022-07-21T09:49:39Z")

</div>

Your macro does not work:

```auto
% root CDF_77_33.cpp
   ------------------------------------------------------------------
  | Welcome to ROOT 6.27/01 https://root.cern |
  | (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Jul 21 2022, 08:50:28 |
  | From heads/master@v6-25-02-1851-g2455931919 |
  | With Apple clang version 13.1.6 (clang-1316.0.21.2.5) |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0] 
Processing CDF_77_33.cpp...
 
 
libc++abi: terminating with uncaught exception of type std::invalid_argument: stod: no conversion
%

```
