{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# barplot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This section describes various options available for bar charts in **fivecentplots**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "See the full API https://endangeredoxen.github.io/fivecentplots/0.5.0/api/bar.html#bar" ] }, { "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": [ "Read some fake bar chart data with 3 replicates of pH data for various liquids measured at multiple temperatures:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | \n", " | \n", " | pH | \n", "
---|---|---|---|
Liquid | \n", "Measurement | \n", "T [C] | \n", "\n", " |
Battery acid | \n", "A | \n", "25 | \n", "1 | \n", "
100 | \n", "1 | \n", "||
B | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
C | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
Bottled water | \n", "A | \n", "25 | \n", "1 | \n", "
100 | \n", "1 | \n", "||
B | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
C | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
Coke | \n", "A | \n", "25 | \n", "1 | \n", "
100 | \n", "1 | \n", "||
B | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
C | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
Lemon juice | \n", "A | \n", "25 | \n", "1 | \n", "
100 | \n", "1 | \n", "||
B | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
C | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
Orange juice | \n", "A | \n", "25 | \n", "1 | \n", "
100 | \n", "1 | \n", "||
B | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "||
C | \n", "25 | \n", "1 | \n", "|
100 | \n", "1 | \n", "
For convenience, fivecentplots often supports two versions of plot-specific keywords (in this case, horizontal or bar_horizontal). For inline plotting the shorter version may be preferred but for cases where kwargs are pulled from theme files or when precision is required to avoid applying a particular kwarg to other `Elements` in the plot, the long version is recommended.
\n", "