Python seaborn图形化

3

大家好,我想将 Kaggle 的一个教程代码应用到鸢尾花数据集上。

但是当我执行绘图代码时,只能看到以下输出,而没有看到任何图形:

matplotlib.axes._subplots.AxesSubplot at 0x9abf9b0

有什么想法吗?

以下是代码:

import warnings # current version of seaborn generates a bunch of warnings that we'll ignore
warnings.filterwarnings("ignore")
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", color_codes=True)

# Next, we'll load the Iris flower dataset, which is in the "../input/" directory
iris = pd.read_csv("../input/Iris.csv") # the iris dataset is now a Pandas DataFrame

# We'll use this to make a scatterplot of the Iris features.
iris.plot(kind="scatter", x="SepalLengthCm", y="SepalWidthCm")

可能需要使用 %%matplotlib inlineiris.plot(...).show() - Wayne Werner
1个回答

0
如果您正在使用IPython Notebook,只需在绘制图形之前使用%pylab inline命令即可。如果不是,请在绘制图形后尝试使用plt.show()

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接