Fix: prevent divide-by-zero in AxisItem

This commit is contained in:
Luke Campagnola 2014-01-05 14:40:56 -05:00
parent eda59be46d
commit 33e4a9e213
2 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,7 @@ pyqtgraph-0.9.9 [unreleased]
- fixed PlotCurveItem generating exceptions when data has length=0
- fixed ImageView.setImage only working once
- PolyLineROI.setPen() now changes the pen of its segments as well
- Prevent divide-by-zero in AxisItem
pyqtgraph-0.9.8 2013-11-24

View File

@ -458,8 +458,7 @@ class AxisItem(GraphicsWidget):
return []
## decide optimal minor tick spacing in pixels (this is just aesthetics)
pixelSpacing = size / np.log(size)
optimalTickCount = max(2., size / pixelSpacing)
optimalTickCount = max(2., np.log(size))
## optimal minor tick spacing
optimalSpacing = dif / optimalTickCount