Automatic histogram filling

9 views
Skip to first unread message

Ruggero Turra

unread,
Apr 8, 2013, 3:38:55 AM4/8/13
to rootp...@googlegroups.com
Hello I have createad a new branch in my fork:

https://github.com/wiso/rootpy/tree/histo-filldata

it introduce a new free function:

FillHistogram(data, *args, **kwargs)

the interesting point is the "binning" argument wich allow you to specify a particular method to automatically choose a binning for 1D histograms.

Have a look to the example

examples/plotting/fill_hist.py

here a screenshot of the result.

The implentation is not complete, I am asking for your feedback: for example is it ok to use free functions? Do you prefer a method? ...

Cheers,
Ruggero
autobinning.png

Christoph Deil

unread,
Apr 8, 2013, 3:58:54 AM4/8/13
to rootp...@googlegroups.com
Hi Ruggero,

On Apr 8, 2013, at 9:38 AM, Ruggero Turra <giur...@gmail.com> wrote:

Hello I have createad a new branch in my fork:

https://github.com/wiso/rootpy/tree/histo-filldata

Cool!

Can you make a pull request against rootpy master and start the title with "WIP" for "work in progress" so we know you don't think it's ready to be merged?
That way we can have the API / implementation discussion on github, which usually works better than on the mailing list.


it introduce a new free function:

FillHistogram(data, *args, **kwargs)

the interesting point is the "binning" argument wich allow you to specify a particular method to automatically choose a binning for 1D histograms.

I didn't look yet … just a thought:
Noel already implemented filling of histograms from numpy arrays.
If you duplicate code / functionality there it might be better if you write a function that only computes the binning and then people will do (pseudo-code):
```
xbins = wiso_clever_automatic_binning(data)
hist = Hist(data, xbins=xbins)
```


Have a look to the example

examples/plotting/fill_hist.py

here a screenshot of the result.

The implentation is not complete, I am asking for your feedback: for example is it ok to use free functions? Do you prefer a method? ...

Cheers,
Ruggero

--
You received this message because you are subscribed to the Google Groups "rootpy dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rootpy-dev+...@googlegroups.com.
To post to this group, send email to rootp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rootpy-dev/-/0AC4KUAVz84J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
<autobinning.png>

Reply all
Reply to author
Forward
0 new messages