{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9252d5a5-8af1-4f99-b799-ee044329fb23",
   "metadata": {
    "tags": [
     "hide"
    ]
   },
   "outputs": [],
   "source": [
    "import seaborn.objects as so"
   ]
  },
  {
   "cell_type": "raw",
   "id": "1888667e-8761-4c32-9510-68e08e64f21d",
   "metadata": {},
   "source": [
    "By default, plot limits are automatically set to provide a small margin around the data (controlled by :meth:`Plot.theme` parameters `axes.xmargin` and `axes.ymargin`):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "25ec46d9-3c60-4962-b182-a2b2c8310305",
   "metadata": {},
   "outputs": [],
   "source": [
    "p = so.Plot(x=[1, 2, 3], y=[1, 3, 2]).add(so.Line(marker=\"o\"))\n",
    "p"
   ]
  },
  {
   "cell_type": "raw",
   "id": "5f5c19d8-4104-4df0-ae45-9a8ac96d024e",
   "metadata": {},
   "source": [
    "Pass a `min`/`max` tuple to pin the limits at specific values:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "804388c5-5efa-4cfb-92d8-97fdf838ae5e",
   "metadata": {},
   "outputs": [],
   "source": [
    "p.limit(x=(0, 4), y=(-1, 6))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "49634203-4c77-42ae-abc1-b182671f305e",
   "metadata": {},
   "source": [
    "Reversing the `min`/`max` values will invert the axis:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6ea1c82c-a9bc-43cc-ba75-5ee28923b8f2",
   "metadata": {},
   "outputs": [],
   "source": [
    "p.limit(y=(4, 0))"
   ]
  },
  {
   "cell_type": "raw",
   "id": "9bb25c70-3960-4a81-891c-2bd299e7b24f",
   "metadata": {},
   "source": [
    "Use `None` for either side to maintain the default value:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d0566ba8-707c-4808-9a76-525ccaef7a42",
   "metadata": {},
   "outputs": [],
   "source": [
    "p.limit(y=(0, None))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fefc2b45-3510-4cd7-9de9-4806d71fc4c1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py310",
   "language": "python",
   "name": "py310"
  },
  "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
