Let's put the concepts from this chapter into practice. We've explored several Seaborn functions designed to help us understand how data is distributed. Now, we'll apply histplot, kdeplot, boxplot, violinplot, and jointplot to a real dataset to gain insights.Setting UpFirst, ensure you have the necessary libraries imported. We'll use Seaborn for plotting, Matplotlib for potential adjustments (like controlling figure size), and Pandas to handle our data. We will use the built-in 'tips' dataset available directly within Seaborn. This dataset contains information about tips given in a restaurant.import seaborn as sns import matplotlib.pyplot as plt import pandas as pd # Load the example dataset tips = sns.load_dataset("tips") # Display the first few rows to understand the data print(tips.head())The output will show columns like total_bill, tip, sex, smoker, day, time, and size. These columns provide a mix of numerical and categorical data, perfect for exploring distributions.Visualizing Single Variable Distributions: Histograms and KDELet's start by examining the distribution of the total_bill amount. A histogram is a great way to see the frequency of different bill ranges.Histogram (histplot)We can create a histogram of the total_bill column using sns.histplot().plt.figure(figsize=(8, 5)) # Control figure size for better readability sns.histplot(data=tips, x="total_bill") plt.title("Distribution of Total Bill Amounts") plt.xlabel("Total Bill ($)") plt.ylabel("Frequency") plt.show(){"layout": {"title": "Distribution of Total Bill Amounts", "xaxis": {"title": "Total Bill ($)"}, "yaxis": {"title": "Frequency"}, "bargap": 0.1, "width": 600, "height": 400}, "data": [{"type": "histogram", "x": [23.68, 10.34, 21.01, 23.68, 24.59, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 35.26, 15.42, 18.43, 14.83, 21.58, 10.33, 16.29, 16.97, 20.65, 17.92, 20.29, 15.77, 39.42, 19.82, 17.81, 12.9, 17.51, 20.08, 19.65, 9.55, 18.35, 15.06, 20.69, 17.78, 24.06, 16.31, 16.93, 18.69, 31.27, 16.04, 17.46, 13.94, 9.68, 30.4, 18.29, 22.23, 32.4, 28.55, 18.04, 12.54, 10.29, 34.81, 9.94, 25.56, 19.49, 28.17, 12.02, 17.07, 26.86, 25.28, 14.73, 10.51, 17.92, 27.2, 22.76, 17.29, 19.44, 16.66, 10.07, 32.68, 15.98, 34.83, 13.03, 18.28, 24.71, 25.29, 18.26, 15.47, 10.59, 10.63, 13.81, 11.02, 18.29, 17.59, 20.08, 16.45, 11.35, 20.27, 28.97, 22.49, 5.75, 16.32, 22.12, 24.01, 15.69, 11.61, 11.17, 12.26, 18.26, 12.46, 11.87, 7.25, 31.85, 16.82, 13.42, 8.58, 15.95, 12.48, 29.8, 9.78, 14.12, 16.49, 21.5, 12.6, 16.21, 13.81, 13.0, 7.25, 30.46, 18.15, 23.33, 26.59, 38.73, 24.27, 12.76, 30.06, 20.49, 25.0, 13.39, 16.47, 26.41, 11.24, 14.38, 15.01, 9.6, 13.16, 17.47, 34.3, 41.19, 27.05, 16.43, 20.53, 20.45, 13.28, 22.42, 19.08, 15.38, 20.76, 16.58, 10.09, 15.79, 8.51, 10.33, 14.15, 12.6, 13.0, 13.51, 18.43, 23.1, 15.69, 19.81, 28.44, 11.59, 7.74, 16.99, 15.53, 10.07, 12.6, 32.9, 17.89, 14.48, 9.68, 11.69, 13.42, 14.26, 15.95, 16.97, 15.18, 14.0, 11.38, 22.82, 19.08, 20.23, 15.01, 12.02, 17.07, 16.27, 10.09, 20.92, 29.03, 27.18, 22.67, 17.82, 18.78, 30.14, 21.01, 12.31, 24.08, 11.67, 34.63, 34.65, 23.17, 20.65, 11.87, 11.15, 12.43, 24.08, 13.27, 8.35, 35.83, 29.85, 48.27, 13.13, 17.26, 13.0, 14.31, 7.51, 10.77, 15.69, 8.52, 14.52, 11.35, 15.36, 20.45, 18.15, 23.1, 40.17, 27.28, 12.16, 13.42, 48.33, 26.0, 10.65, 12.03, 21.01, 16.4, 13.16, 22.75, 40.55, 20.69, 7.56, 10.34, 43.11, 28.15, 21.5, 12.9, 18.04, 38.07, 23.95, 25.71, 48.17, 25.0, 38.01, 21.16, 18.69, 15.06, 11.45, 12.02, 13.42, 50.81, 15.81, 7.25, 11.61, 29.93, 27.18, 16.99], "marker": {"color": "#228be6"}}]}Distribution of total bill amounts. Most bills are between $10 and $20.Histogram with Kernel Density Estimate (KDE)Sometimes, a smooth curve representing the estimated probability density is helpful. We can add this using kde=True or create it separately with sns.kdeplot().plt.figure(figsize=(8, 5)) sns.histplot(data=tips, x="total_bill", kde=True, color="#1098ad") # Using kde=True plt.title("Distribution of Total Bill Amounts with KDE") plt.xlabel("Total Bill ($)") plt.ylabel("Frequency / Density") plt.show() # Or using kdeplot separately plt.figure(figsize=(8, 5)) sns.kdeplot(data=tips, x="total_bill", color="#f76707", fill=True) # fill adds color under the curve plt.title("KDE of Total Bill Amounts") plt.xlabel("Total Bill ($)") plt.ylabel("Density") plt.show(){"layout": {"title": "KDE of Total Bill Amounts", "xaxis": {"title": "Total Bill ($)"}, "yaxis": {"title": "Density"}, "width": 600, "height": 400}, "data": [{"type": "scatter", "x": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0], "y": [0.0002, 0.001, 0.0025, 0.005, 0.008, 0.012, 0.017, 0.022, 0.028, 0.033, 0.038, 0.042, 0.045, 0.047, 0.048, 0.048, 0.048, 0.046, 0.044, 0.042, 0.039, 0.036, 0.033, 0.03, 0.027, 0.024, 0.021, 0.019, 0.017, 0.015, 0.013, 0.011, 0.01, 0.008, 0.007, 0.006, 0.005, 0.004, 0.0035, 0.003, 0.0025, 0.002, 0.0018, 0.0015, 0.0012, 0.001, 0.0008, 0.0006, 0.0005, 0.0004, 0.0003], "mode": "lines", "fill": "tozeroy", "line": {"color": "#f76707"}}]}Smoothed Kernel Density Estimate (KDE) of total bill amounts, highlighting the peak around $15-$20 and the right skew.The KDE provides a smoother representation of the distribution's shape compared to the histogram's discrete bins.Comparing Distributions: Box Plots and Violin PlotsOften, we want to compare the distribution of a numerical variable across different categories. Let's compare the total_bill distribution based on the day of the week.Box Plot (boxplot)A box plot summarizes the distribution using quartiles. The box represents the interquartile range (IQR), the line inside is the median, and the whiskers typically extend to 1.5 times the IQR. Points outside the whiskers are potential outliers.plt.figure(figsize=(8, 6)) sns.boxplot(data=tips, x="day", y="total_bill", palette="viridis") # using a different palette plt.title("Total Bill Distribution by Day") plt.xlabel("Day of the Week") plt.ylabel("Total Bill ($)") plt.show(){"layout": {"title": "Total Bill Distribution by Day", "xaxis": {"title": "Day of the Week", "categoryorder": "array", "categoryarray": ["Thur", "Fri", "Sat", "Sun"]}, "yaxis": {"title": "Total Bill ($)"}, "boxmode": "group", "width": 600, "height": 450}, "data": [{"type": "box", "name": "Thur", "y": [16.31, 16.93, 10.51, 10.33, 16.29, 10.07, 34.83, 13.03, 18.28, 18.26, 15.47, 10.59, 10.63, 13.81, 11.02, 18.29, 20.27, 22.49, 16.32, 22.12, 11.61, 11.17, 12.26, 18.26, 11.87, 13.42, 14.12, 16.49, 21.5, 12.6, 16.21, 13.81, 13.0, 30.46, 18.15, 23.33, 12.76, 30.06, 20.49, 13.39, 16.47, 11.24, 14.38, 15.01, 9.6, 13.16, 17.47, 34.3, 16.43, 20.53, 13.28, 15.38, 16.58, 10.09, 8.51, 10.33, 14.15, 12.6, 13.0, 13.51, 18.43, 23.1, 15.69], "marker": {"color": "#440154"}}, {"type": "box", "name": "Fri", "y": [22.76, 17.29, 19.44, 16.66, 5.75, 24.01, 15.69, 12.46, 7.25, 16.82, 8.58, 9.78, 7.25, 26.59, 11.35, 40.17, 12.16, 13.42, 16.04, 7.56], "marker": {"color": "#31688e"}}, {"type": "box", "name": "Sat", "y": [20.65, 17.92, 20.29, 15.77, 39.42, 19.82, 17.81, 12.9, 17.51, 20.08, 19.65, 9.55, 18.35, 15.06, 20.69, 17.78, 24.06, 18.69, 31.27, 17.46, 13.94, 9.68, 30.4, 18.29, 22.23, 32.4, 28.55, 18.04, 12.54, 10.29, 34.81, 9.94, 25.56, 19.49, 28.17, 12.02, 17.07, 26.86, 25.28, 14.73, 17.92, 27.2, 32.68, 15.98, 24.71, 25.29, 17.59, 20.08, 16.45, 28.97, 11.35, 31.85, 15.95, 12.48, 29.8, 38.73, 24.27, 25.0, 26.41, 41.19, 27.05, 20.45, 22.42, 19.08, 20.76, 15.79, 15.69, 19.81, 28.44, 11.59, 7.74, 16.99, 15.53, 10.07, 12.6, 32.9, 17.89, 14.48, 9.68, 11.69, 13.42, 14.26, 15.95, 16.97, 15.18, 14.0, 11.38, 22.82, 19.08, 20.23, 15.01, 12.02, 17.07, 16.27, 10.09, 20.92, 50.81, 15.81, 7.25, 11.61, 29.93, 27.18, 16.99], "marker": {"color": "#35b779"}}, {"type": "box", "name": "Sun", "y": [10.34, 21.01, 23.68, 24.59, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 35.26, 15.42, 18.43, 14.83, 21.58, 16.97, 34.83, 23.17, 20.65, 11.87, 11.15, 12.43, 24.08, 13.27, 8.35, 35.83, 29.85, 48.27, 13.13, 17.26, 13.0, 14.31, 7.51, 10.77, 15.69, 8.52, 14.52, 11.35, 15.36, 20.45, 18.15, 23.1, 40.55, 20.69, 10.34, 43.11, 28.15, 21.5, 12.9, 18.04, 38.07, 23.95, 25.71, 48.17, 25.0, 38.01, 21.16, 18.69, 15.06, 11.45, 12.02, 13.42, 48.33, 26.0, 10.65, 12.03, 21.01, 16.4, 13.16, 22.75], "marker": {"color": "#fde725"}}]}Comparison of total bill distribution by day. Weekend days (Sat, Sun) tend to have higher median bills and a wider range compared to weekdays.Violin Plot (violinplot)A violin plot combines a box plot with a KDE plot, showing the distribution's shape alongside the summary statistics.plt.figure(figsize=(8, 6)) sns.violinplot(data=tips, x="day", y="total_bill", palette="plasma", inner="quartile") # inner='quartile' shows quartiles inside plt.title("Total Bill Distribution by Day (Violin Plot)") plt.xlabel("Day of the Week") plt.ylabel("Total Bill ($)") plt.show(){"layout": {"title": "Total Bill Distribution by Day (Violin Plot)", "xaxis": {"title": "Day of the Week", "categoryorder": "array", "categoryarray": ["Thur", "Fri", "Sat", "Sun"]}, "yaxis": {"title": "Total Bill ($)"}, "violinmode": "group", "width": 600, "height": 450}, "data": [{"type": "violin", "name": "Thur", "y": [16.31, 16.93, 10.51, 10.33, 16.29, 10.07, 34.83, 13.03, 18.28, 18.26, 15.47, 10.59, 10.63, 13.81, 11.02, 18.29, 20.27, 22.49, 16.32, 22.12, 11.61, 11.17, 12.26, 18.26, 11.87, 13.42, 14.12, 16.49, 21.5, 12.6, 16.21, 13.81, 13.0, 30.46, 18.15, 23.33, 12.76, 30.06, 20.49, 13.39, 16.47, 11.24, 14.38, 15.01, 9.6, 13.16, 17.47, 34.3, 16.43, 20.53, 13.28, 15.38, 16.58, 10.09, 8.51, 10.33, 14.15, 12.6, 13.0, 13.51, 18.43, 23.1, 15.69], "points": false, "box": {"visible": true, "width": 0.2}, "meanline": {"visible": false}, "line": {"color": "#f0f921"}, "fillcolor": "rgba(240, 249, 33, 0.5)"}, {"type": "violin", "name": "Fri", "y": [22.76, 17.29, 19.44, 16.66, 5.75, 24.01, 15.69, 12.46, 7.25, 16.82, 8.58, 9.78, 7.25, 26.59, 11.35, 40.17, 12.16, 13.42, 16.04, 7.56], "points": false, "box": {"visible": true, "width": 0.2}, "meanline": {"visible": false}, "line": {"color": "#fd8b2d"}, "fillcolor": "rgba(253, 139, 45, 0.5)"}, {"type": "violin", "name": "Sat", "y": [20.65, 17.92, 20.29, 15.77, 39.42, 19.82, 17.81, 12.9, 17.51, 20.08, 19.65, 9.55, 18.35, 15.06, 20.69, 17.78, 24.06, 18.69, 31.27, 17.46, 13.94, 9.68, 30.4, 18.29, 22.23, 32.4, 28.55, 18.04, 12.54, 10.29, 34.81, 9.94, 25.56, 19.49, 28.17, 12.02, 17.07, 26.86, 25.28, 14.73, 17.92, 27.2, 32.68, 15.98, 24.71, 25.29, 17.59, 20.08, 16.45, 28.97, 11.35, 31.85, 15.95, 12.48, 29.8, 38.73, 24.27, 25.0, 26.41, 41.19, 27.05, 20.45, 22.42, 19.08, 20.76, 15.79, 15.69, 19.81, 28.44, 11.59, 7.74, 16.99, 15.53, 10.07, 12.6, 32.9, 17.89, 14.48, 9.68, 11.69, 13.42, 14.26, 15.95, 16.97, 15.18, 14.0, 11.38, 22.82, 19.08, 20.23, 15.01, 12.02, 17.07, 16.27, 10.09, 20.92, 50.81, 15.81, 7.25, 11.61, 29.93, 27.18, 16.99], "points": false, "box": {"visible": true, "width": 0.2}, "meanline": {"visible": false}, "line": {"color": "#bd3786"}, "fillcolor": "rgba(189, 55, 134, 0.5)"}, {"type": "violin", "name": "Sun", "y": [10.34, 21.01, 23.68, 24.59, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 35.26, 15.42, 18.43, 14.83, 21.58, 16.97, 34.83, 23.17, 20.65, 11.87, 11.15, 12.43, 24.08, 13.27, 8.35, 35.83, 29.85, 48.27, 13.13, 17.26, 13.0, 14.31, 7.51, 10.77, 15.69, 8.52, 14.52, 11.35, 15.36, 20.45, 18.15, 23.1, 40.55, 20.69, 10.34, 43.11, 28.15, 21.5, 12.9, 18.04, 38.07, 23.95, 25.71, 48.17, 25.0, 38.01, 21.16, 18.69, 15.06, 11.45, 12.02, 13.42, 48.33, 26.0, 10.65, 12.03, 21.01, 16.4, 13.16, 22.75], "points": false, "box": {"visible": true, "width": 0.2}, "meanline": {"visible": false}, "line": {"color": "#51127c"}, "fillcolor": "rgba(81, 18, 124, 0.5)"}]}Violin plot comparing total bill distribution by day. The shape of the violins shows the density, confirming the wider spread and higher concentration of larger bills on weekends.Violin plots give a richer understanding of the distribution's shape than standard box plots, showing multimodality if present.Visualizing Joint DistributionsTo understand the relationship between two numerical variables and their individual distributions simultaneously, we use sns.jointplot(). Let's look at total_bill versus tip.Joint Plot (jointplot)This function creates a scatter plot showing the relationship between the two variables in the center, with histograms (or KDEs) for each variable along the axes.sns.jointplot(data=tips, x="total_bill", y="tip", kind="scatter", color="#37b24d") # kind='scatter' is default plt.suptitle("Joint Distribution of Total Bill and Tip", y=1.02) # Adjust title position plt.show() # We can also use kind='kde' for density contours sns.jointplot(data=tips, x="total_bill", y="tip", kind="kde", color="#7048e8") plt.suptitle("Joint KDE of Total Bill and Tip", y=1.02) plt.show(){"layout": {"title": "Joint Distribution of Total Bill and Tip", "xaxis": {"title": "Total Bill ($)", "domain": [0, 0.85]}, "yaxis": {"title": "Tip ($)", "domain": [0, 0.85]}, "xaxis2": {"domain": [0, 0.85], "anchor": "y", "showticklabels": false}, "yaxis2": {"domain": [0, 0.85], "anchor": "x", "showticklabels": false}, "xaxis3": {"domain": [0.85, 1], "anchor": "y2", "showticklabels": false}, "yaxis3": {"domain": [0.85, 1], "anchor": "x2", "showticklabels": false}, "bargap": 0.1, "width": 600, "height": 600, "showlegend": false}, "data": [{"type": "scatter", "x": [16.99, 10.34, 21.01, 23.68, 24.59, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 35.26, 15.42, 18.43, 14.83, 21.58, 10.33, 16.29, 16.97, 20.65, 17.92, 20.29, 15.77, 39.42, 19.82, 17.81, 12.9, 17.51, 20.08, 19.65, 9.55, 18.35, 15.06, 20.69, 17.78, 24.06, 16.31, 16.93, 18.69, 31.27, 16.04, 17.46, 13.94, 9.68, 30.4, 18.29, 22.23, 32.4, 28.55, 18.04, 12.54, 10.29, 34.81, 9.94, 25.56, 19.49, 28.17, 12.02, 17.07, 26.86, 25.28, 14.73, 10.51, 17.92, 27.2, 22.76, 17.29, 19.44, 16.66, 10.07, 32.68, 15.98, 34.83, 13.03, 18.28, 24.71, 25.29, 18.26, 15.47, 10.59, 10.63, 13.81, 11.02, 18.29, 17.59, 20.08, 16.45, 11.35, 20.27, 28.97, 22.49, 5.75, 16.32, 22.12, 24.01, 15.69, 11.61, 11.17, 12.26, 18.26, 12.46, 11.87, 7.25, 31.85, 16.82, 13.42, 8.58, 15.95, 12.48, 29.8, 9.78, 14.12, 16.49, 21.5, 12.6, 16.21, 13.81, 13.0, 7.25, 30.46, 18.15, 23.33, 26.59, 38.73, 24.27, 12.76, 30.06, 20.49, 25.0, 13.39, 16.47, 26.41, 11.24, 14.38, 15.01, 9.6, 13.16, 17.47, 34.3, 41.19, 27.05, 16.43, 20.53, 20.45, 13.28, 22.42, 19.08, 15.38, 20.76, 16.58, 10.09, 15.79, 8.51, 10.33, 14.15, 12.6, 13.0, 13.51, 18.43, 23.1, 15.69, 19.81, 28.44, 11.59, 7.74, 16.99, 15.53, 10.07, 12.6, 32.9, 17.89, 14.48, 9.68, 11.69, 13.42, 14.26, 15.95, 16.97, 15.18, 14.0, 11.38, 22.82, 19.08, 20.23, 15.01, 12.02, 17.07, 16.27, 10.09, 20.92, 29.03, 27.18, 22.67, 17.82, 18.78, 30.14, 21.01, 12.31, 24.08, 11.67, 34.63, 34.65, 23.17, 20.65, 11.87, 11.15, 12.43, 24.08, 13.27, 8.35, 35.83, 29.85, 48.27, 13.13, 17.26, 13.0, 14.31, 7.51, 10.77, 15.69, 8.52, 14.52, 11.35, 15.36, 20.45, 18.15, 23.1, 40.17, 27.28, 12.16, 13.42, 48.33, 26.0, 10.65, 12.03, 21.01, 16.4, 13.16, 22.75, 40.55, 20.69, 7.56, 10.34, 43.11, 28.15, 21.5, 12.9, 18.04, 38.07, 23.95, 25.71, 48.17, 25.0, 38.01, 21.16, 18.69, 15.06, 11.45, 12.02, 13.42, 50.81, 15.81, 7.25, 11.61, 29.93, 27.18, 16.99], "y": [3.01, 1.66, 3.5, 3.31, 3.61, 4.71, 2.0, 3.12, 1.96, 3.23, 1.71, 5.0, 1.57, 3.0, 3.02, 3.92, 1.67, 3.71, 3.03, 3.11, 3.48, 2.68, 2.23, 7.58, 3.18, 2.34, 2.0, 4.3, 2.71, 3.0, 1.45, 3.65, 2.09, 3.06, 2.47, 3.6, 2.31, 2.5, 3.0, 5.0, 2.24, 3.16, 2.06, 1.32, 5.6, 3.71, 3.0, 4.0, 4.45, 3.46, 2.0, 1.73, 4.19, 1.0, 4.06, 2.51, 4.0, 2.0, 3.0, 4.14, 4.73, 2.2, 1.49, 3.08, 4.0, 4.29, 3.0, 2.56, 2.45, 2.0, 5.85, 3.0, 6.7, 2.0, 2.72, 5.81, 5.0, 2.0, 2.55, 2.0, 1.98, 2.0, 1.97, 3.5, 2.92, 2.55, 2.2, 2.0, 3.0, 1.0, 3.68, 2.75, 2.09, 2.5, 2.39, 1.83, 2.0, 3.14, 2.0, 2.13, 1.0, 3.15, 1.17, 2.0, 1.47, 2.05, 3.0, 4.0, 1.25, 2.88, 3.51, 3.5, 2.0, 3.77, 2.18, 2.0, 1.0, 4.54, 1.85, 4.67, 3.41, 5.0, 3.73, 2.24, 5.0, 2.51, 5.0, 2.61, 3.53, 3.59, 1.76, 2.62, 2.99, 1.0, 2.83, 2.53, 6.73, 5.0, 3.97, 2.57, 2.47, 4.0, 2.7, 3.29, 3.92, 2.64, 4.0, 3.42, 2.0, 1.47, 1.48, 2.0, 2.0, 2.0, 2.45, 1.57, 4.0, 2.3, 3.35, 4.08, 1.98, 1.25, 3.01, 2.47, 2.0, 2.0, 5.17, 3.14, 2.52, 1.32, 2.0, 2.0, 2.74, 2.03, 3.27, 2.86, 2.0, 2.0, 2.5, 4.0, 3.0, 4.0, 3.0, 5.0, 5.0, 4.0, 3.55, 2.15, 1.85, 2.05, 3.0, 2.76, 1.65, 6.0, 4.15, 3.5, 1.87, 2.74, 2.0, 2.6, 1.0, 1.5, 2.5, 1.48, 2.0, 2.64, 2.44, 3.48, 4.0, 5.0, 2.0, 2.0, 6.5, 3.0, 1.5, 1.98, 3.0, 2.6, 2.5, 4.0, 4.2, 3.0, 1.44, 2.56, 5.0, 3.0, 3.5, 2.1, 3.0, 5.95, 3.05, 3.25, 3.35, 5.0, 4.0, 3.0, 2.0, 2.5, 1.56, 2.0, 10.0, 2.9, 1.01, 1.58, 5.14, 5.0, 3.0], "mode": "markers", "marker": {"color": "#37b24d", "size": 6}, "xaxis": "x", "yaxis": "y"}, {"type": "histogram", "x": [16.99, 10.34, 21.01, 23.68, 24.59, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 35.26, 15.42, 18.43, 14.83, 21.58, 10.33, 16.29, 16.97, 20.65, 17.92, 20.29, 15.77, 39.42, 19.82, 17.81, 12.9, 17.51, 20.08, 19.65, 9.55, 18.35, 15.06, 20.69, 17.78, 24.06, 16.31, 16.93, 18.69, 31.27, 16.04, 17.46, 13.94, 9.68, 30.4, 18.29, 22.23, 32.4, 28.55, 18.04, 12.54, 10.29, 34.81, 9.94, 25.56, 19.49, 28.17, 12.02, 17.07, 26.86, 25.28, 14.73, 10.51, 17.92, 27.2, 22.76, 17.29, 19.44, 16.66, 10.07, 32.68, 15.98, 34.83, 13.03, 18.28, 24.71, 25.29, 18.26, 15.47, 10.59, 10.63, 13.81, 11.02, 18.29, 17.59, 20.08, 16.45, 11.35, 20.27, 28.97, 22.49, 5.75, 16.32, 22.12, 24.01, 15.69, 11.61, 11.17, 12.26, 18.26, 12.46, 11.87, 7.25, 31.85, 16.82, 13.42, 8.58, 15.95, 12.48, 29.8, 9.78, 14.12, 16.49, 21.5, 12.6, 16.21, 13.81, 13.0, 7.25, 30.46, 18.15, 23.33, 26.59, 38.73, 24.27, 12.76, 30.06, 20.49, 25.0, 13.39, 16.47, 26.41, 11.24, 14.38, 15.01, 9.6, 13.16, 17.47, 34.3, 41.19, 27.05, 16.43, 20.53, 20.45, 13.28, 22.42, 19.08, 15.38, 20.76, 16.58, 10.09, 15.79, 8.51, 10.33, 14.15, 12.6, 13.0, 13.51, 18.43, 23.1, 15.69, 19.81, 28.44, 11.59, 7.74, 16.99, 15.53, 10.07, 12.6, 32.9, 17.89, 14.48, 9.68, 11.69, 13.42, 14.26, 15.95, 16.97, 15.18, 14.0, 11.38, 22.82, 19.08, 20.23, 15.01, 12.02, 17.07, 16.27, 10.09, 20.92, 29.03, 27.18, 22.67, 17.82, 18.78, 30.14, 21.01, 12.31, 24.08, 11.67, 34.63, 34.65, 23.17, 20.65, 11.87, 11.15, 12.43, 24.08, 13.27, 8.35, 35.83, 29.85, 48.27, 13.13, 17.26, 13.0, 14.31, 7.51, 10.77, 15.69, 8.52, 14.52, 11.35, 15.36, 20.45, 18.15, 23.1, 40.17, 27.28, 12.16, 13.42, 48.33, 26.0, 10.65, 12.03, 21.01, 16.4, 13.16, 22.75, 40.55, 20.69, 7.56, 10.34, 43.11, 28.15, 21.5, 12.9, 18.04, 38.07, 23.95, 25.71, 48.17, 25.0, 38.01, 21.16, 18.69, 15.06, 11.45, 12.02, 13.42, 50.81, 15.81, 7.25, 11.61, 29.93, 27.18, 16.99], "marker": {"color": "#37b24d"}, "xaxis": "x2", "yaxis": "y3"}, {"type": "histogram", "y": [3.01, 1.66, 3.5, 3.31, 3.61, 4.71, 2.0, 3.12, 1.96, 3.23, 1.71, 5.0, 1.57, 3.0, 3.02, 3.92, 1.67, 3.71, 3.03, 3.11, 3.48, 2.68, 2.23, 7.58, 3.18, 2.34, 2.0, 4.3, 2.71, 3.0, 1.45, 3.65, 2.09, 3.06, 2.47, 3.6, 2.31, 2.5, 3.0, 5.0, 2.24, 3.16, 2.06, 1.32, 5.6, 3.71, 3.0, 4.0, 4.45, 3.46, 2.0, 1.73, 4.19, 1.0, 4.06, 2.51, 4.0, 2.0, 3.0, 4.14, 4.73, 2.2, 1.49, 3.08, 4.0, 4.29, 3.0, 2.56, 2.45, 2.0, 5.85, 3.0, 6.7, 2.0, 2.72, 5.81, 5.0, 2.0, 2.55, 2.0, 1.98, 2.0, 1.97, 3.5, 2.92, 2.55, 2.2, 2.0, 3.0, 1.0, 3.68, 2.75, 2.09, 2.5, 2.39, 1.83, 2.0, 3.14, 2.0, 2.13, 1.0, 3.15, 1.17, 2.0, 1.47, 2.05, 3.0, 4.0, 1.25, 2.88, 3.51, 3.5, 2.0, 3.77, 2.18, 2.0, 1.0, 4.54, 1.85, 4.67, 3.41, 5.0, 3.73, 2.24, 5.0, 2.51, 5.0, 2.61, 3.53, 3.59, 1.76, 2.62, 2.99, 1.0, 2.83, 2.53, 6.73, 5.0, 3.97, 2.57, 2.47, 4.0, 2.7, 3.29, 3.92, 2.64, 4.0, 3.42, 2.0, 1.47, 1.48, 2.0, 2.0, 2.0, 2.45, 1.57, 4.0, 2.3, 3.35, 4.08, 1.98, 1.25, 3.01, 2.47, 2.0, 2.0, 5.17, 3.14, 2.52, 1.32, 2.0, 2.0, 2.74, 2.03, 3.27, 2.86, 2.0, 2.0, 2.5, 4.0, 3.0, 4.0, 3.0, 5.0, 5.0, 4.0, 3.55, 2.15, 1.85, 2.05, 3.0, 2.76, 1.65, 6.0, 4.15, 3.5, 1.87, 2.74, 2.0, 2.6, 1.0, 1.5, 2.5, 1.48, 2.0, 2.64, 2.44, 3.48, 4.0, 5.0, 2.0, 2.0, 6.5, 3.0, 1.5, 1.98, 3.0, 2.6, 2.5, 4.0, 4.2, 3.0, 1.44, 2.56, 5.0, 3.0, 3.5, 2.1, 3.0, 5.95, 3.05, 3.25, 3.35, 5.0, 4.0, 3.0, 2.0, 2.5, 1.56, 2.0, 10.0, 2.9, 1.01, 1.58, 5.14, 5.0, 3.0], "marker": {"color": "#37b24d"}, "xaxis": "x3", "yaxis": "y2"}]}Joint plot showing the relationship between total bill and tip amount. The scatter plot indicates a positive correlation, while the histograms on the margins show the individual distributions of each variable.This practical exercise demonstrates how Seaborn's distribution plots provide powerful tools for exploring and comparing data distributions, both for single variables and relationships between variables. Experiment further by applying these plots to other numerical and categorical columns in the tips dataset or your own data.