【发布时间】:2020-05-03 06:53:37
【问题描述】:
我写了这段代码。它应该在 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")
Spyder IDE 显示以下消息而不是绘图
图形现在默认呈现在“绘图”窗格中。让他们也 出现在控制台中,取消选中“Mute Inline Plotting”下 绘图窗格选项菜单。
我已经在 google colab 中测试了这段代码。它绘制所需的图表。我如何在 Spyder IDE 中绘图。 我正在使用 Spyder 4.0.1。我没有找到任何“静音内联绘图”选项来取消选中
【问题讨论】:
-
完全按照它告诉你的内容进行
-
我在 spyder ide 中没有找到“静音内联绘图”选项
-
还应该验证“绘图”窗格是否可见。转到 View -> Panes 并检查“Plots”案例。
标签: python matplotlib anaconda ipython spyder