weird bug for log-scaling fixed; fixes T248

This commit is contained in:
Dominik Demuth
2022-12-30 14:06:25 +01:00
parent b1e54c8432
commit bf437ef8a7
3 changed files with 23 additions and 7 deletions

View File

@ -179,8 +179,12 @@ class PlotItem(PlotDataItem):
self.opts['linecolor'] = c.red(), c.green(), c.blue()
if self.symbol != SymbolStyle.No:
c = self.opts['symbolBrush'].color()
self.opts['symbolcolor'] = c.red(), c.green(), c.blue()
brush = self.opts['symbolBrush']
if isinstance(brush, tuple):
self.opts['symbolcolor'] = brush
else:
c = brush.color()
self.opts['symbolcolor'] = c.red(), c.green(), c.blue()
def __getitem__(self, item):
return self.opts.get(item, None)
@ -229,7 +233,7 @@ class PlotItem(PlotDataItem):
else:
return lc
def updateItems(self):
def updateItems(self, styleUpdate=True):
"""
We override this function so that curves with nan/inf values can be displayed.
Newer versions close this bug differently (https://github.com/pyqtgraph/pyqtgraph/pull/1058)
@ -261,6 +265,7 @@ class PlotItem(PlotDataItem):
# remove all bad values
x = x[is_finite]
y = y[is_finite]
curveArgs['connect'] = 'all'
self.curve.setData(x=x, y=y, **curveArgs)
self.curve.show()
else: