Spyder 4 不显示绘图并显示类似“在绘图窗格选项菜单下取消选中“静音内联绘图”这样的消息。

8 python matplotlib ipython spyder anaconda

我写了这段代码。它应该在 spyder ide 中显示图。

import pandas as pd
import numpy as np 
import matplotlib.pyplot as plt
from IPython.display import display
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_absolute_error
import scipy.signal
import scipy.stats
from sklearn.model_selection import train_test_split


train = pd.read_csv("train.csv", nrows=9000000,dtype={'acoustic_data':np.int16,'time_to_failure':np.float64})

train.rename({"acoustic_data": "signal", "time_to_failure": "quaketime"}, axis="columns", inplace=True)      

#visualization(train,title="Acoustic data and time to failure: sampled data")
fig, ax = plt.subplots(2,1, figsize=(20,12))
ax[0].plot(train.index.values, train.quaketime.values, c="darkred")
ax[0].set_title("Quaketime of 10 Mio rows")
ax[0].set_xlabel("Index")
ax[0].set_ylabel("Quaketime in ms")
ax[1].plot(train.index.values, train.signal.values, c="mediumseagreen")
ax[1].set_title("Signal of 10 Mio rows")
ax[1].set_xlabel("Index")
ax[1].set_ylabel("Acoustic Signal")
Run Code Online (Sandbox Code Playgroud)

Spyder IDE 显示以下消息而不是绘图

图形现在默认呈现在“绘图”窗格中。要使它们也内联显示在控制台中,请取消选中“绘图”窗格选项菜单下的“静音内联绘图”。

我已经在 google colab 中测试了这段代码。它绘制所需的图形。我如何在 Spyder IDE 中绘图。我正在使用 Spyder 4.0.1。我没有找到任何要取消选中的“静音内联绘图”选项

rog*_*osh 39

您所拥有的既不是错误也不是警告。这是一个指令。您可以找到以下选项:

在此处输入图片说明

忽略控制台输出,这只是为了让您了解 Spyder 4.0.1 的方向。