On Wed, Aug 11, 2010 at 3:11 PM, Benjamin Root <ben.r...@ou.edu> wrote:

> I am tracing down a bug in hist() and I am trying to figure out what is it
> about the 'stepfilled' mode that is different from the regular 'bar' mode.
> Currently, the hist() code has a separate if branch for dealing with 'step'
> and 'stepfilled', and that branch has a bunch of bugs.  The best that I can
> figure is that it prevents lines from being drawn in between the bins.  If
> that is the only difference, maybe we could somehow use the bar functions?
>
> At the very least, I think this needs to be documented better to make it
> clear why this oddball approach is happening.
>
> Thanks,
> Ben Root
>

By the way, the bugs I was referring to both have to do with log=True and
the two stepped modes.

First, the smallest of values to histogram (the minimum bin value) is, for
some reason, used to clip the lower bounds of the histogram count. In some
situations, this can result in most if not all the graph not being shown.

Second, related to the first is a problem with the 'stepfilled' mode in log
space.  The stepfilled mode uses the minimum bin value to anchor the
patches.  However, this can cause the polygon to not close correctly and can
get some unsightly artifacts. I have attached an image demonstrating this
bug.  This has been reported before:

http://old.nabble.com/hist%28%29-with-log-and-step-tp28888742p28888742.html
http://old.nabble.com/Bug-in-stepfilled-hist-with-log-y-tp28538074p28538074.html

In one of the comments, the reporter concluded that it appeared fixed, but
either he was experiencing a slightly different problem, or he was mistaken.

I have also included a possible patch for addressing these issues.  The
approach simply sets the minimum value to be zero when not doing log, and
use 1.0 when log=True.  This differs slightly from how the normal bar graphs
are done where a value of 1e-100 is used when log=True, but then the axes
limits are adjusted to use 1.0 as a lower limit.

Cheers,
Ben Root

<<attachment: stepfilledBug.png>>

Attachment: histlog.patch
Description: Binary data

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to