{ "cells": [ { "cell_type": "markdown", "id": "3b84ddbc-2079-48c9-a38b-b0a34abd6d27", "metadata": {}, "source": [ "# Multivariate views" ] }, { "cell_type": "markdown", "id": "23618ebe-f01c-47b9-aa85-ce4ad6d01619", "metadata": {}, "source": [ "In this notebook, we show a few examples of how to have plots with graphs of different types in a figure, like having a scatter plot with marginal distributions or even a multivariate plot with pair relationships of all properties in a table.\n", "\n", "Because these plots involve managing subplots, they are all figure-level functions." ] }, { "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" ] }, { "cell_type": "markdown", "id": "88932903-b980-42a3-b6e8-3f42327735c6", "metadata": {}, "source": [ "We start by loading a table of measurments into a pandas 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", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
106 | \n", "305 | \n", "88.252459 | \n", "20.226532 | \n", "19.244210 | \n", "1.051045 | \n", "20P1_POS0007_D_1UL | \n", "
107 | \n", "593 | \n", "89.905565 | \n", "36.508370 | \n", "21.365394 | \n", "1.708762 | \n", "20P1_POS0007_D_1UL | \n", "
108 | \n", "289 | \n", "106.851211 | \n", "20.427809 | \n", "18.221452 | \n", "1.121086 | \n", "20P1_POS0007_D_1UL | \n", "
109 | \n", "277 | \n", "100.664260 | \n", "20.307965 | \n", "17.432920 | \n", "1.164920 | \n", "20P1_POS0007_D_1UL | \n", "
110 | \n", "46 | \n", "70.869565 | \n", "11.648895 | \n", "5.298003 | \n", "2.198733 | \n", "20P1_POS0007_D_1UL | \n", "
111 rows × 6 columns
\n", "