text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

train_data = pd.read_csv('/kaggle/input/titanic/train.csv')

test_data = pd.read_csv('/kaggle/input/titanic/test.csv')

v = sns.FacetGrid(train_data, col='Survived')
v.map(plt.hist, 'Age', bins=10, color='red')

v = sns.FacetGrid(train_data, col='Survived', row='Pclass')
v.map(plt.hist, 'Age', bins=10, color='green')
v.add_legend()

v = sns.FacetGrid(train_data, col='Survived', row='Pclass')
v.map(sns.scatterplot, 'Age', 'Sex', color='orange')
v.add_legend()

v = sns.FacetGrid(train_data, row='Embarked')
v.map(sns.pointplot, 'Pclass', 'Survived', 'Sex')
v.add_legend()