No warning for arrays with zeros in logscale
NumPy evaluates log10(0) to -inf, so there is no reason to show the user a RuntimeWarning. Before, if visualizing data arrays containing zeros in logscale, a RuntimeWarning was shown.
This commit is contained in:
parent
e5e103de6d
commit
0f149f38c2
@ -515,10 +515,12 @@ class PlotDataItem(GraphicsObject):
|
||||
if self.opts['logMode'][0]:
|
||||
x=x[1:]
|
||||
y=y[1:]
|
||||
if self.opts['logMode'][0]:
|
||||
x = np.log10(x)
|
||||
if self.opts['logMode'][1]:
|
||||
y = np.log10(y)
|
||||
|
||||
with np.errstate(divide='ignore'):
|
||||
if self.opts['logMode'][0]:
|
||||
x = np.log10(x)
|
||||
if self.opts['logMode'][1]:
|
||||
y = np.log10(y)
|
||||
|
||||
ds = self.opts['downsample']
|
||||
if not isinstance(ds, int):
|
||||
|
Loading…
Reference in New Issue
Block a user