histogram bug

You have to make sure your yaxis limits are strictly

    > positive, eg

    > ax.set_ylim(1e-3, 1e3) ax.set_yscale('log')

No that won't quite do it, sorry for the noise. The problem is that
the histogram bottom of the rectangle is zero by default, and
transforming those vertices are causing the problem. You need to use
the "bottom" kwarg to set the bottom of the bars to be positive, eg

hist(rand(100), 20, bottom=1e-3)

JDH

Oops, I replied to your previous message before seeing this one.

Still, the larger question remains: maybe we should do something to make it easier for users to understand what is going on when the transform chokes on log(0). Changing numbers <=0 to a small positive number and issuing a warning would accomplish this, and I don't see much disadvantage.

Eric

John Hunter wrote:

···

    > You have to make sure your yaxis limits are strictly
    > positive, eg

    > ax.set_ylim(1e-3, 1e3) ax.set_yscale('log')

No that won't quite do it, sorry for the noise. The problem is that
the histogram bottom of the rectangle is zero by default, and
transforming those vertices are causing the problem. You need to use
the "bottom" kwarg to set the bottom of the bars to be positive, eg

hist(rand(100), 20, bottom=1e-3)

JDH

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users