Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THistSaveAs txt or csv #10474

Closed
ferdymercury opened this issue Apr 27, 2022 · 0 comments · Fixed by #14713
Closed

THistSaveAs txt or csv #10474

ferdymercury opened this issue Apr 27, 2022 · 0 comments · Fixed by #14713
Assignees
Labels

Comments

@ferdymercury
Copy link
Collaborator

ferdymercury commented Apr 27, 2022

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.
#9491 (comment)

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 #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants