|
From: Anne A. <aar...@ph...> - 2010-08-25 02:01:36
|
On 24 August 2010 19:16, Erik Tollerud <eri...@gm...> wrote: > Whoops, yes, that should be True... Also realized a slight error in > the description of how the mimum is set - both of those are fixed in > the attached diff. Um, this is a kind of important point of style: it is much better to use "if foo:" than "if foo is True:" or even "if foo == True:". Long-standing python convention allows things like 1, 7.0, numpy booleans that are true, and nonempty lists to have a value of True. Using "if foo:", this works. Using "if foo is True:", this cannot possibly work; even though 1==True, it is not true that 1 is True. "is" has a very specific meaning that should be used only when appropriate (generally, for None or for mutable objects). Incidentally, the stairstep look of histograms is something I use a lot. But if we're looking for bells and whistles to add, I often need error bars on the histogram values (usually the error bar should be the square root of the value, though for really small values there's a correction based on Poisson statistics). Since I also often deal with background-subtracted histograms that often need to repeat the data, I expect to need to use errorbar() regardless, so I wouldn't worry too much about this. Anne > On Tue, Aug 24, 2010 at 1:53 PM, Eric Firing <ef...@ha...> wrote: >> On 08/24/2010 08:39 AM, Erik Tollerud wrote: >>> I just realized the patch I sent before includes some other changes... >>> the attached version should only be the fix for this particular bug. >> >> + if log is true: >> + minimum = 1.0 >> >> >> Don't you mean True, not true? >> >> Eric >> >> ------------------------------------------------------------------------------ >> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program >> Be part of this innovative community and reach millions of netbook users >> worldwide. Take advantage of special opportunities to increase revenue and >> speed time-to-market. Join now, and jumpstart your future. >> http://p.sf.net/sfu/intel-atom-d2d >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> > > > > -- > Erik Tollerud > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > |