{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Improve figure appearance with ACGC\n",
    "\n",
    "This notebook demonstrates how to load and use the acgc figure style, which produces figures that are closer to publication ready than the defaults within Matplotlib."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Default Maplotlib style\n",
    "\n",
    "The first figure is an example of the default Matplotlib style."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, 'Default Matplotlib style')"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 15648 characters]",
      "text/plain": [
       "<Figure size 300x300 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Figure showing the default Matplotlib style\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "f = plt.figure(figsize=(3,3))\n",
    "ax = f.add_subplot()\n",
    "ax.scatter( range(10), range(10) )\n",
    "ax.scatter( range(10), range(10,0,-1) )\n",
    "ax.set_xlabel('x axis')\n",
    "ax.set_ylabel('y axis')\n",
    "\n",
    "ax.set_title('Default Matplotlib style')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## ACGC figure style\n",
    "The next example uses ```acgc.figstyle``` to make figures closer to publication ready. The features include \n",
    "* font update (similar to Helvetica)\n",
    "* minor tick lines on both axes\n",
    "* spacing adjustments between figure panels\n",
    "* grid lines optional\n",
    "\n",
    " The style is activated by importing the module:\n",
    "```from acgc import figstyle```\n",
    "\n",
    "By default, the ACGC style includes grid lines. Grid lines can be turned off with\n",
    "\n",
    "```figstyle.grid_off()```\n",
    "\n",
    "Grid lines can be turned on with\n",
    "\n",
    "```figstyle.grid_on()```  \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, 'ACGC style, grid off')"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 40744 characters]",
      "text/plain": [
       "<Figure size 500x300 with 2 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 311,
       "width": 511
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Load the style\n",
    "from acgc import figstyle\n",
    "f = plt.figure(figsize=(5,3))\n",
    "\n",
    "# Left panel with gridlines (default)\n",
    "ax = f.add_subplot(1,2,1)\n",
    "ax.scatter( range(10), range(10) )\n",
    "ax.set_xlabel('x axis')\n",
    "ax.set_ylabel('y axis')\n",
    "ax.set_title('ACGC style, grid on')\n",
    "\n",
    "# Turn gridlines off\n",
    "figstyle.grid_off()\n",
    "\n",
    "# Right panel without gridlines\n",
    "ax = f.add_subplot(1,2,2)\n",
    "ax.scatter( range(10), range(10) )\n",
    "ax.set_xlabel('x axis')\n",
    "ax.set_ylabel('y axis')\n",
    "ax.set_title('ACGC style, grid off')\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "general",
   "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.11.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
