text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

train_data = pd.read_csv('../input/train.csv')
test_data = pd.read_csv('../input/test.csv')

train_data.drop(['PassengerId', 'Ticket', 'Cabin', 'Name'], inplace=True, axis=1)

plt.tick_params(top='off', bottom='on', left='off', right='off', labelleft='on', labelbottom='on')
plt.xlim([0, 4])
ax = plt.gca()
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(True)
ax.spines['bottom'].set_visible(True)
ax.set_xticks([1, 2, 3])
plt.tight_layout()

plt.hist(train_data['Survived'], color='lightblue')
plt.tick_params(top='off', bottom='off', left='off', right='off', labelleft='on', labelbottom='on')
ax = plt.gca()
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(True)
ax.spines['bottom'].set_visible(True)
plt.grid(True)
plt.xlim([-1, 2])
ax.set_xticks([0, 1])
ax.set_xticklabels(['Not survived', 'Survived'], rotation='vertical')
plt.ylabel('Count')
plt.tight_layout()