Astropy: Plotting the output of astropy.stats.histogram

Created on 4 Apr 2017  路  2Comments  路  Source: astropy/astropy

Hi all,

first of all, thanks for the nice methods that you guys have implemented for the histogram. Knuth and blocks, in particular, are so useful, you saved my day a couple of times.

However, I just wanted to mention a minor issue.
I think it would be great to a have a feature that would help plotting the output of the astropy histogram in somethin like a one-liner.
What I usually do is:

hist,bin_ed = histogram(mydata,...more options....,bins='knuth')

And then

for k,h in enumerate(hist):
       ax.add_patch(patches.Rectangle((bin_ed[k], 0), bin_ed[k+1]-bin_ed[k],  h, 
                       ...more options...))

Now, wouldn't it be great to be able to have the matplolib plotting capabilities and the astropy histogram bin computing feature together?
Something like:

ax.plot_this_astropy_object_and_make_it_look_like_the_default_histogram(myastropy_bayesian_blocks_histogram_object)

I am not even sure this is an issue for astropy, maybe it is rather a matplotlib one, but I'd like some feedback on my request.

Thanks,
Mario

stats visualization

Most helpful comment

What about http://docs.astropy.org/en/stable/visualization/histogram.html? :)

All 2 comments

What about http://docs.astropy.org/en/stable/visualization/histogram.html? :)

Oh wow,
that was easy ;)

Thanks a lot...I'll let the STScI python users know that this exists....because they didn;t know, or at least me and several others of them !
Mario

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gabriel-p picture Gabriel-p  路  3Comments

funbaker picture funbaker  路  3Comments

pllim picture pllim  路  3Comments

bmorris3 picture bmorris3  路  3Comments

simontorres picture simontorres  路  3Comments