FIX: Protection over downsampling calculation.
This commit is contained in:
parent
574c5f3a47
commit
984eb5ed29
@ -527,8 +527,9 @@ class PlotDataItem(GraphicsObject):
|
|||||||
if self.opts['autoDownsample']:
|
if self.opts['autoDownsample']:
|
||||||
# this option presumes that x-values have uniform spacing
|
# this option presumes that x-values have uniform spacing
|
||||||
range = self.viewRect()
|
range = self.viewRect()
|
||||||
if range is not None:
|
if range is not None and len(x) > 1:
|
||||||
dx = float(x[-1]-x[0]) / (len(x)-1)
|
dx = float(x[-1]-x[0]) / (len(x)-1)
|
||||||
|
if dx != 0.0:
|
||||||
x0 = (range.left()-x[0]) / dx
|
x0 = (range.left()-x[0]) / dx
|
||||||
x1 = (range.right()-x[0]) / dx
|
x1 = (range.right()-x[0]) / dx
|
||||||
width = self.getViewBox().width()
|
width = self.getViewBox().width()
|
||||||
|
Loading…
Reference in New Issue
Block a user