Here is the explanation of the preceding code.
This is the first plot:
- sns.pairplot(snacks_sales_items, hue='Promotion', kind='reg') creates and plots the required grid:
- snacks_sales_items is the dataset we have just created for this recipe.
- hue='Promotion' specifies the hue variable.
- kind='reg' specifies that a regression plot should be plotted for all bivariate plots.
- On the diagonal, it plots the univariate kdeplot() by default.
Upon execution, you should see the following plot on your screen:
This is the second plot:
- sns.pairplot(snacks_sales_items, vars=['Coffee', 'Pies'],hue='Promotion', kind='reg') plots only two ...