在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>

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

this is the output i am getting while running the code

解决方法

在代码开头使用%matplotlib时,我得到了答案。这对我来说是如何工作的。enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...