{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# plot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This section describes various options available for xy plots in **fivecentplots**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "See the full API https://endangeredoxen.github.io/fivecentplots/0.5.0/api/plot.html#plot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import fivecentplots as fcp\n", "import pandas as pd\n", "from pathlib import Path" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Sample data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We will use two fake datasets in this tutorial: \n", "\n", "1) make-believe current vs voltage data for a set of diodes [`df`] \n", "\n", "2) a time-series dataset for \"happiness\" data, derived from an undisclosed bodily orifice [`ts`]. " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Substrate | \n", "Target Wavelength | \n", "Boost Level | \n", "Temperature [C] | \n", "Die | \n", "Voltage | \n", "I Set | \n", "I [A] | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
1 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.1 | \n", "0.0 | \n", "0.0 | \n", "
2 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.2 | \n", "0.0 | \n", "0.0 | \n", "
3 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.3 | \n", "0.0 | \n", "0.0 | \n", "
4 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.4 | \n", "0.0 | \n", "0.0 | \n", "
5 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.5 | \n", "0.0 | \n", "0.0 | \n", "
6 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.6 | \n", "0.0 | \n", "0.0 | \n", "
7 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.7 | \n", "0.0 | \n", "0.0 | \n", "
8 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.8 | \n", "0.0 | \n", "0.0 | \n", "
9 | \n", "Si | \n", "450 | \n", "0.2 | \n", "25 | \n", "(1,1) | \n", "0.9 | \n", "0.0 | \n", "0.0 | \n", "
\n", " | Date | \n", "Happiness Quotient | \n", "
---|---|---|
0 | \n", "1/1/2015 | \n", "16.088954 | \n", "
1 | \n", "1/2/2015 | \n", "18.186724 | \n", "
2 | \n", "1/3/2015 | \n", "35.744313 | \n", "
3 | \n", "1/4/2015 | \n", "38.134045 | \n", "
4 | \n", "1/5/2015 | \n", "46.147279 | \n", "
In the example above, we are selecting specific data based on values in four different DataFrame columns (\"Substrate\", \"Target Wavelength\", \"Boost Level\", and \"Temperature\"). This is conveniently achieved using fivecentplots's built-in `filter` tool, which uses an easy, human-readable string to sub-sample a dataset. Alternatively, could also have applied filtering directly to the input DataFrame as shown below, but this feels a bit cumbersome:\n", " \n", "`df_sub = df[(df['Substrate']==\"Si\")&(df['Target Wavelength']==450)&(df['Boost Level']==0.2)&(df['Temperature [C]']==25)]`\n", " \n", "Read more about fivecentplots filtering here.
\n", "Note: kwargs related to the primary axes are suffixed with `_x` or `_y`. Keywords related to the secondary axis are suffixed with `_x2` and `_y2`.
\n", "\n", " | x | \n", "y | \n", "
---|---|---|
0 | \n", "-1.0 | \n", "-10.715459 | \n", "
1 | \n", "-1.0 | \n", "-9.972410 | \n", "
2 | \n", "-1.0 | \n", "-30.740532 | \n", "
3 | \n", "-1.0 | \n", "-31.368963 | \n", "
4 | \n", "-1.0 | \n", "-29.058633 | \n", "