From: Manuel M. <mm...@as...> - 2008-05-16 14:59:41
|
Johann Cohen-Tanugi wrote: > hello, > is there an example in the distribution that shows these new features? I just added an example to the trunk, see examples/histogram_demo_step.py > How about the idea to allow for an option to get cumulative histograms, > that sounded a very nice idea.... I also added the keyword 'cumulative' to the axes hist() method. Actually, in the current version, if cumulative=True AND normed=True the cumulative histogram is normed to 1, which seemed to be most convenient to me (rather than 1/binwidths which is what numpy.hist actually does). Manuel > thanks, > Johann > > Manuel Metz wrote: >> Eric Firing wrote: >> >>> John Hunter wrote: >>> >>>> On Wed, Apr 2, 2008 at 6:39 PM, Erik Tollerud <eri...@gm...> wrote: >>>> >>>> >>>>> are slightly different). There's a slight compatibility issue in that >>>>> as it stands in that the returned tuple now has 4 values (I added a >>>>> list of the lines that are generated if the steps command is used), >>>>> but I can't really imagine how that could break anything but the >>>>> poorest-written code... >>>>> >>>> I'm not sure I understand this: won't it break all code written like: >>>> >>>> n, bins, patches = ax.hist(x, 50, normed=1) >>>> >>>> which is the code presented in the histogram example and a fairly >>>> common approach. I don't see this as an example of the "poorest >>>> written code". I am inclined to not break this call signature >>>> unless the lines are actually used, ie 'step' in histtype. On a quick >>>> read of the code, you either get lines or patches but not both, so how >>>> about >>>> >>>> n, bins, patches = ax.hist(x, 50, normed=1) >>>> >>>> or >>>> >>>> n, bins, lines = ax.hist(x, 50, normed=1, histtype='lines') >>>> >>> That was my first reaction also, but the proposed "stepfill" option >>> yields a bunch of bar patches *and* a line. The solution may be to >>> accomplish "stepfill" with two separate calls, or to have 4 outputs only >>> in the "stepfill" case. Or, with sufficient rewriting I think the >>> "stepfill" case could yield a single patch and a single line, and the >>> third output in this case could be a single corresponding 2-element >>> tuple or list. That is, the third output is considered simply a list of >>> artists. Now I will stop speculating and leave it to Manuel to sort out. >>> >>> Eric >>> >> I have just committed a patch to add the histogram step functionality. I >> took Erik Tollerud's patch as basis, but basically re-wrote it >> completely in the end ... >> >> The advantages are: (i) considerably smaller code and (ii) return >> values are unchanged, ie. >> >> n, bins, patches = ax.hist(x, 50) >> n, bins, patches = ax.hist(x, 50, histtype='step') >> >> In contrast to the original patch, histtype='step' is filled and to >> produce a non-filled histogram, one has to use facecolor='None'. >> >> Hope I haven't overlooked anything or broken other code ;-) >> >> Manuel >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |