首页 > 解决方案 > 在 miniconda 中使用 ipython 时没有得到情节

问题描述

当我在 ipython 中使用 matplotlib 时,我没有得到任何情节。代码如下:

%matplotlib inline
import matplotlib.pyplot as plt
sns.set() # use Seaborn styles
births.pivot_table('births', index='year', columns='gender', aggfunc='sum').plot()
plt.ylabel('total births per year');

我得到一个输出:

<Figure size 432x288 with 1 Axes>

这是我在运行代码时得到的输出: 这是我在运行代码时得到的输出

标签: pythonpandasmatplotlibplotminiconda

解决方案


当我在代码开头使用 %matplotlib 时,我得到了答案。这对我来说是如何工作的。在此处输入图像描述


推荐阅读