{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2012390c-5173-41b4-9fc5-77a9965c8e1b",
   "metadata": {},
   "source": [
    "---\n",
    "title: \"Worldwide Development\"\n",
    "author: \"Gapminder Analytics\"\n",
    "format: dashboard\n",
    "---\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8fa027e0-4540-4af5-85a6-7d9b66118c85",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc966fea-0467-450a-8062-aed74f3308b3",
   "metadata": {},
   "source": [
    "# Indicators"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b26a7906-9034-4431-8407-147c8a3d04ef",
   "metadata": {},
   "source": [
    "## Row {height=60%}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "f3c12459-57ee-4c6f-93c2-f35234c317b7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 24672 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#| title: GDP and Life Expectancy \n",
    "\n",
    "\n",
    "fig, ax = plt.subplots()\n",
    "\n",
    "fruits = ['apple', 'blueberry', 'cherry', 'orange']\n",
    "counts = [40, 100, 30, 55]\n",
    "bar_labels = ['red', 'blue', '_red', 'orange']\n",
    "bar_colors = ['tab:red', 'tab:blue', 'tab:red', 'tab:orange']\n",
    "\n",
    "ax.bar(fruits, counts, label=bar_labels, color=bar_colors)\n",
    "\n",
    "ax.set_ylabel('fruit supply')\n",
    "ax.set_title('Fruit supply by kind and color')\n",
    "ax.legend(title='Fruit color')\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cc08806e-2fa8-41ea-8a56-faaceb9bc19f",
   "metadata": {},
   "source": [
    "## Row {height=40%}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "26865c36-e7a6-433b-bb65-3eedf13ae86c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 18884 characters]",
      "text/plain": [
       "<Figure size 900x300 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#| title: Population\n",
    "data = {'apple': 10, 'orange': 15, 'lemon': 5, 'lime': 20}\n",
    "names = list(data.keys())\n",
    "values = list(data.values())\n",
    "\n",
    "fig, axs = plt.subplots(1, 3, figsize=(9, 3), sharey=True)\n",
    "axs[0].bar(names, values)\n",
    "axs[1].scatter(names, values)\n",
    "axs[2].plot(names, values)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "27f9e01c-f192-4212-8d40-c7f96bbbeaee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 36100 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#| title: Life Expectancy\n",
    "cat = [\"bored\", \"happy\", \"bored\", \"bored\", \"happy\", \"bored\"]\n",
    "dog = [\"happy\", \"happy\", \"happy\", \"happy\", \"bored\", \"bored\"]\n",
    "activity = [\"combing\", \"drinking\", \"feeding\", \"napping\", \"playing\", \"washing\"]\n",
    "\n",
    "fig, ax = plt.subplots()\n",
    "ax.plot(activity, dog, label=\"dog\")\n",
    "ax.plot(activity, cat, label=\"cat\")\n",
    "ax.legend()\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9c1e36ed-cf39-4ece-b52f-eadaaf862f10",
   "metadata": {},
   "source": [
    "# Data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7737d30f-4048-4a22-a6e2-b1a5abfbd9fb",
   "metadata": {},
   "source": [
    "![](gapminder-logo.svg){width=150} Learn more about the Gapminder dataset at <https://www.gapminder.org/data/documentation/>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
