Q1. Scenario: Load the tips dataset from seaborn (sns.load_dataset(''tips'')). Create a scatter plot of total_bill vs tip, colored by day.
import seaborn as sns; tips = sns.load_dataset(''tips''); sns.scatterplot(data=tips, x=''total_bill'', y=''tip'', hue=''day''). sns automatically adds legend. Great for quick exploratory analysis.
Q2. Scenario: Create a histogram of 'total_bill' with KDE overlay using seaborn's distplot (now histplot).
sns.histplot(tips[''total_bill''], kde=True, bins=20). Also sns.kdeplot(tips[''total_bill'']) for just KDE. Histograms with KDE show distribution shape.
Q3. Scenario: Use sns.boxplot to show distribution of tip by day, and add swarmplot on top for individual points.
sns.boxplot(data=tips, x=''day'', y=''tip''); sns.swarmplot(data=tips, x=''day'', y=''tip'', color=''black'', alpha=0.6). Swarmplot shows data points. Avoid overlapping by using dodge.
Q4. Scenario: Create a heatmap of correlation matrix for numeric columns of tips dataset.
corr = tips.select_dtypes(include=''number'').corr(); sns.heatmap(corr, annot=True, cmap=''coolwarm'', fmt=''.2f''). annot shows correlation values. Heatmaps identify feature correlations.
Q5. Scenario: Create a pairplot to visualize relationships between multiple numeric variables, colored by 'time' (Lunch/Dinner).
sns.pairplot(tips, vars=[''total_bill'',''tip'',''size''], hue=''time''). Pairplot shows scatter plots for each pair and histograms on diagonal. Useful for initial inspection.
