问题描述
我在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>
这是我在运行代码时得到的输出:
解决方法
在代码开头使用%matplotlib时,我得到了答案。这对我来说是如何工作的。