opened 03:30PM - 27 Apr 22 UTC
improvement
good first issue
priority:low
in:Graphics
### Explain what you would like to see improved
I open this to keep track of a …suggestion by @lmoneta to save histograms as csv or txt files.
https://github.com/root-project/root/issues/9491#issuecomment-1094786152
Right now, there are all sorts of workarounds to achieve this (see below), but they are easy to forget and periodically there are new questions on the forum wrt the same thing.
A function doing
`TH1::SaveAs(".txt")`
would be more user-friendly.
### Optional: share how it could be improved
Move TGraph implementation in https://github.com/root-project/root/issues/9491 to a class THistSaveAs
### Setup
```
------------------------------------------------------------------
| Welcome to ROOT 6.24/06 https://root.cern |
| (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Sep 02 2021, 14:20:23 |
| From tags/v6-24-06@v6-24-06 |
| With |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
```
### Additional context
https://root-forum.cern.ch/t/save-data-points-from-a-histogram-in-a-txt-file/49768/3
https://root-forum.cern.ch/t/save-histogram-in-txt-file/43616/13
https://stackoverflow.com/questions/28970124/cern-root-exporting-data-to-plain-text
https://root-forum.cern.ch/t/save-the-contents-of-histogram-to-text-file/28616/2
https://root-forum.cern.ch/t/histogram-to-ascii/14080/6