Applying a similar fix to r8873 which seemed to only have been applied to the development branch.
This fixes a math domain error when using log scales.
Authored by: weathergod 2011-01-05
Parent: [r8890]
Child: [r8892]