How to see the plot made in python using pandas and matplotlib
<p>I am following the tutorial <a href="http://ahmedbesbes.com/how-to-score-08134-in-titanic-kaggle-challenge.html" rel="nofollow">http://ahmedbesbes.com/how-to-score-08134-in-titanic-kaggle-challenge.html</a> and following is my code</p>

<pre><code>from IPython.core.display import HTML
HTML("""
&lt;style&gt;
.output_png {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}
&lt;/style&gt;
""")

# remove warnings
import warnings
warnings.filterwarnings('ignore')
# ---

import pandas as pd
pd.options.display.max_columns = 100
import matplotlib

matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
import numpy as np

pd.options.display.max_rows = 100


data = pd.read_csv('./data/train.csv')

data.head()

data['Age'].fillna(data['Age'].median(), inplace=True)
survived_sex = data[data['Survived']==1]['Sex'].value_counts()
dead_sex = data[data['Survived']==0]['Sex'].value_counts()
df = pd.DataFrame([survived_sex,dead_sex])
df.index = ['Survived','Dead']
df.plot(kind='bar',stacked=True, figsize=(15,8))
</code></pre>

<p>I dont actually see the plot. How do i see the plot?</p>

<p><a href="http://i.stack.imgur.com/g24E6.png" rel="nofollow"><img src="http://i.stack.imgur.com/g24E6.png" alt="enter image description here"></a></p>

<p>Try using <code>plt.show()</code> at the end.</p>

<p>EDIT:</p>

<p>Also, you may need to add <code>%matplotlib inline</code> as explained here: <a href="http://stackoverflow.com/questions/19410042/how-to-make-ipython-notebook-matplotlib-plot-inline">How to make IPython notebook matplotlib plot inline</a></p>

python matplotlib