Fix log hist y-axis minimum with weighted data

This applies @duncanmmacleod's fix for #2945 and modifies an existing test to cover the bug.