{ "cells": [ { "cell_type": "markdown", "id": "3b84ddbc-2079-48c9-a38b-b0a34abd6d27", "metadata": {}, "source": [ "# Plotting Distributions with Seaborn" ] }, { "cell_type": "markdown", "id": "66ebc29e-9f74-4333-ab93-9e163d1d5ce7", "metadata": {}, "source": [ "With Seaborn, it is also very practical to plot data distributions. We start with simple boxplots and bar graphs. Then, we show how to plot histograms and kde." ] }, { "cell_type": "code", "execution_count": 1, "id": "ec137599-b8bd-4666-b5f7-13e94243b50e", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "sns.set_theme()" ] }, { "cell_type": "markdown", "id": "88932903-b980-42a3-b6e8-3f42327735c6", "metadata": {}, "source": [ "Let's load the same dataframe." ] }, { "cell_type": "code", "execution_count": 2, "id": "c0a502d8-9181-47b4-8e6b-63b37ed3a8d4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | area | \n", "intensity_mean | \n", "major_axis_length | \n", "minor_axis_length | \n", "aspect_ratio | \n", "file_name | \n", "
---|---|---|---|---|---|---|
0 | \n", "139 | \n", "96.546763 | \n", "17.504104 | \n", "10.292770 | \n", "1.700621 | \n", "20P1_POS0010_D_1UL | \n", "
1 | \n", "360 | \n", "86.613889 | \n", "35.746808 | \n", "14.983124 | \n", "2.385805 | \n", "20P1_POS0010_D_1UL | \n", "
2 | \n", "43 | \n", "91.488372 | \n", "12.967884 | \n", "4.351573 | \n", "2.980045 | \n", "20P1_POS0010_D_1UL | \n", "
3 | \n", "140 | \n", "73.742857 | \n", "18.940508 | \n", "10.314404 | \n", "1.836316 | \n", "20P1_POS0010_D_1UL | \n", "
4 | \n", "144 | \n", "89.375000 | \n", "13.639308 | \n", "13.458532 | \n", "1.013432 | \n", "20P1_POS0010_D_1UL | \n", "