Fix: PlotCurveItem now ignores clip-to-view when auto-range is enabled.
This commit is contained in:
parent
eae32af0c7
commit
ca68f05f1f
@ -41,6 +41,7 @@ pyqtgraph-0.9.9 [unreleased]
|
|||||||
- PolyLineROI.setPen() now changes the pen of its segments as well
|
- PolyLineROI.setPen() now changes the pen of its segments as well
|
||||||
- Prevent divide-by-zero in AxisItem
|
- Prevent divide-by-zero in AxisItem
|
||||||
- Major speedup when using ScatterPlotItem in pxMode
|
- Major speedup when using ScatterPlotItem in pxMode
|
||||||
|
- PlotCurveItem ignores clip-to-view when auto range is enabled
|
||||||
|
|
||||||
pyqtgraph-0.9.8 2013-11-24
|
pyqtgraph-0.9.8 2013-11-24
|
||||||
|
|
||||||
|
@ -531,15 +531,17 @@ class PlotDataItem(GraphicsObject):
|
|||||||
## downsampling is expensive; delay until after clipping.
|
## downsampling is expensive; delay until after clipping.
|
||||||
|
|
||||||
if self.opts['clipToView']:
|
if self.opts['clipToView']:
|
||||||
# this option presumes that x-values have uniform spacing
|
view = self.getViewBox()
|
||||||
range = self.viewRect()
|
if view is None or not view.autoRangeEnabled()[0]:
|
||||||
if range is not None:
|
# this option presumes that x-values have uniform spacing
|
||||||
dx = float(x[-1]-x[0]) / (len(x)-1)
|
range = self.viewRect()
|
||||||
# clip to visible region extended by downsampling value
|
if range is not None:
|
||||||
x0 = np.clip(int((range.left()-x[0])/dx)-1*ds , 0, len(x)-1)
|
dx = float(x[-1]-x[0]) / (len(x)-1)
|
||||||
x1 = np.clip(int((range.right()-x[0])/dx)+2*ds , 0, len(x)-1)
|
# clip to visible region extended by downsampling value
|
||||||
x = x[x0:x1]
|
x0 = np.clip(int((range.left()-x[0])/dx)-1*ds , 0, len(x)-1)
|
||||||
y = y[x0:x1]
|
x1 = np.clip(int((range.right()-x[0])/dx)+2*ds , 0, len(x)-1)
|
||||||
|
x = x[x0:x1]
|
||||||
|
y = y[x0:x1]
|
||||||
|
|
||||||
if ds > 1:
|
if ds > 1:
|
||||||
if self.opts['downsampleMethod'] == 'subsample':
|
if self.opts['downsampleMethod'] == 'subsample':
|
||||||
|
Loading…
Reference in New Issue
Block a user