{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "URL: http://bokeh.pydata.org/en/latest/docs/gallery/texas.html\n",
    "\n",
    "Most examples work across multiple plotting backends, this example is also available for:\n",
    "\n",
    "* [Bokeh - texas choropleth example](../bokeh/texas_choropleth_example.ipynb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import holoviews as hv\n",
    "hv.extension('matplotlib')\n",
    "%output fig='svg'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Declaring data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bokeh.sampledata.us_counties import data as counties\n",
    "from bokeh.sampledata.unemployment import data as unemployment\n",
    "\n",
    "counties = [dict(county, Unemployment=unemployment[cid])\n",
    "            for cid, county in counties.items()\n",
    "            if county[\"state\"] == \"tx\"]\n",
    "\n",
    "choropleth = hv.Polygons(counties, ['lons', 'lats'], [('detailed name', 'County'), 'Unemployment'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot_opts = dict(logz=True, xaxis=None, yaxis=None,\n",
    "                 show_grid=False, show_frame=False, colorbar=True,\n",
    "                 fig_size=200, color_index='Unemployment')\n",
    "style = dict(edgecolor='white')\n",
    "\n",
    "choropleth.opts(style=style, plot=plot_opts)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
