I want to plot ndarray using matplotlib. I am using Python 3.10.4 via VS Code version: 1.46.1. However some error message is shown.
x = np.arange(0,1,1/fs)
y = float(sig_amp[0:int(fs),200])
import matplotlib.pyplot as plt
plt.plot(x,y)
plt.show()
where fs is
fs:16000.0
x is
>special variables
>[0:16000]:[0.0, 6.25e-05,...]
>dtype: dtype('float64')
max: 0.9999375
min: 0.0
>shape(16000,)
size: 16000
y is
>special variables
>[0:16000]:[-327,606, -485,...,]
>dtype: dtype('int16')
max: 1787
min: -1802
>shape(16000,)
size: 16000
But error is shown like this.
Traceback (most recent call last):
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\numpy\core\getlimits.py", line 384, in __new__
dtype = numeric.dtype(dtype)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\backends\backend_qt.py", line 455, in _draw_idle
self.draw()
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\backends\backend_agg.py", line 436, in draw
self.figure.draw(self.renderer)
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\artist.py", line 73, in draw_wrapper
result = draw(artist, renderer, *args, **kwargs)
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\artist.py", line 50, in draw_wrapper
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\figure.py", line 2810, in draw
mimage._draw_list_compositing_images(
a.draw(renderer)
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\artist.py", line 50, in draw_wrapper
File "C:\Users\folder\.conda\envs\py310\lib\sitepackages\matplotlib\axes\_base.py", line 3020, in draw
self._unstale_viewLim()
File "C:\Users\folder\.conda\envs\py310\lib\site-packages\matplotlib\axes\_base.py", line 776, in _unstale_viewLim
self.autoscale_view(**{f"scale{name}": scale
handle_single_axis(
File "C:\Users\folder\.conda\envs\py310\lib\site-packages\matplotlib\axes\_base.py", line 2895, in handle_single_axis
File "C:\Users\folder\.conda\envs\py310\lib\site-packages\matplotlib\ticker.py", line 1654, in nonsingular
return mtransforms.nonsingular(v0, v1, expander=.05)
if maxabsvalue < (1e6 / tiny) * np.finfo(float).tiny:
File "C:\Users\folder\.conda\envs\py310\lib\site-packages\numpy\core\getlimits.py", line 387, in __new__
TypeError: 'NoneType' object is not callable
Would you tell me what should I change?