问题遇到的现象和发生背景
matplotlib.colors.LogNorm代码设置横纵参数的时候出错
问题相关代码,请勿粘贴截图
nm= matplotlib.colors.LogNorm(vmin=psd.min(),vmax=psd.max())
dx=(t[1]-t[0])/2
dy=(f[1]-f[0])/2
xmesh=t-dx
xmesh=np.append(xmesh,t[-1]+dx)
ymesh=f-dy
ymesh=np.append(ymesh,f[-1]+dy)
运行结果及报错内容
warnings.warn('nperseg = {0:d} is greater than input length '
UserWarning: nperseg = 256 is greater than input length = 100, using nperseg = 100
Traceback (most recent call last):
File "E:\python practice\1234\plmi.py", line 83, in <module>
dx=(t[1]-t[0])/2
IndexError: index 1 is out of bounds for axis 0 with size 1