【发布时间】:2022-01-07 00:20:53
【问题描述】:
尝试在 spyder IDE 版本 5.1.5 中运行此示例脚本
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.gridspec as gridspec
# Fixing random state for reproducibility
np.random.seed(19680801)
dt = 0.01
t = np.arange(0, 10, dt)
nse = np.random.randn(len(t))
r = np.exp(-t / 0.05)
cnse = np.convolve(nse, r) * dt
cnse = cnse[:len(t)]
s = 0.1 * np.sin(2 * np.pi * t) + cnse
fig, (ax0, ax1) = plt.subplots(2, 1)
ax0.plot(t, s)
ax1.psd(s, 512, 1 / dt)
plt.show()
导致
Restarting kernel...
没有任何进一步的错误消息。 Python 版本是 3.8.12,安装了 Anaconda。
【问题讨论】:
-
你的 matplotlib 版本是多少?也许这可能与github.com/spyder-ide/spyder/issues/16659有关解决方案:github.com/spyder-ide/spyder/issues/…