Load the ‘tips’ dataset. Create a PairGrid which shows a histogram on the diagonal, a scatter plot on the upper triangle, and a kde plot on the lower triangle.
Example Output:
Create a sns.PairGrid, then use the map_diag, map_upper, and map_lower functions.
import seaborn as sns
import matplotlib.pyplot as plt
def plot_complex_pairgrid():
tips_data = sns.load_dataset('tips')
g = sns.PairGrid(tips_data)
g.map_diag(plt.hist)
g.map_upper(plt.scatter)
g.map_lower(sns.kdeplot)
plt.show()
plot_complex_pairgrid()
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.