SEABORN PAIR PLOTS
This section contains several Python-based code samples that show you how to use the Seaborn pair_plot() method to render pair plots.
Listing 5.37 displays the contents seaborn_pairplot1.py that displays a pair plot with the Iris dataset.
Listing 5.37: seaborn_pairplot1.py
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
# load iris data
iris = sns.load_dataset("iris")
df = pd.DataFrame(iris)
# construct and display iris plot
g = sns.pairplot(df, height=2, aspect=1.0)
plt.show()
Listing 5.38 contains import statements and then initializes the variable iris with the built-in Iris dataset. The next code snippet initializes the DataFrame df with the contents of the Iris dataset. The final code portion of Listing 5.38 constructs a pair plot of the Iris dataset and then displays the output. Figure 5.24 displays a plot of the data in the Titanic dataset based on the code in Listing 5.38.

FIGURE 5.24 A Seaborn pair plot.
Listing 5...