matplotlib.colors.LogNorm代码设置横纵参数报错

问题遇到的现象和发生背景

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

我的解答思路和尝试过的方法
我想要达到的结果

img

在dx=(t[1]-t[0])/2之前,加print(t)
输出t看看是不是只有1个维度