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

    
    
    from IPython.core.display import HTML
    HTML("""
    <style>
    .output_png {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
    }
    </style>
    """)
    
    # 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))
    

I dont actually see the plot. How do i see the plot?

[![enter image description
here](http://i.stack.imgur.com/g24E6.png)](http://i.stack.imgur.com/g24E6.png)


Answer: Try using `plt.show()` at the end.

EDIT:

Also, you may need to add `%matplotlib inline` as explained here: [How to make
IPython notebook matplotlib plot
inline](http://stackoverflow.com/questions/19410042/how-to-make-ipython-
notebook-matplotlib-plot-inline)

