{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div class=\"contentcontainer med left\" style=\"margin-left: -50px;\">\n",
    "<dl class=\"dl-horizontal\">\n",
    "  <dt>Title</dt> <dd> Bounds Element</dd>\n",
    "  <dt>Dependencies</dt> <dd>Matplotlib</dd>\n",
    "  <dt>Backends</dt> <dd><a href='./Bounds.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/Bounds.ipynb'>Bokeh</a></dd>\n",
    "</dl>\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import holoviews as hv\n",
    "hv.extension('matplotlib')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A ``Bounds`` element is an box shaped annotation that is specified as a tuple in (left, bottom, right, top) format:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%opts Bounds (color='orange' linewidth=6)\n",
    "penguins = hv.RGB.load_image('../assets/penguins.png')\n",
    "penguins * hv.Bounds((-0.15, -0.4, 0.2, 0))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "It is useful for denoting a region of interest defined by some bounds (such as a slice) which is unlike the [``Box``](./Box.ipynb) element which is useful for drawing a box at a specific location. Here we show the a slice of the ``RGB`` element (green channel only) outlined by the bounds. Note that the values in the ``Bounds`` tuple are the same ones as used in the slice:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "penguins * penguins[-0.15:0.2, -0.4:0, 'G'] * hv.Bounds((-0.15, -0.4, 0.2, 0))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For full documentation and the available style and plot options, use ``hv.help(hv.Bounds).``"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
