{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Most examples work across multiple plotting backends, this example is also available for:\n",
    "\n",
    "* [Bokeh - scatter_economic](../bokeh/scatter_economic.ipynb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import holoviews as hv\n",
    "hv.extension('matplotlib')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Declaring data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "macro_df = pd.read_csv('http://assets.holoviews.org/macro.csv', '\\t')\n",
    "key_dimensions   = [('year', 'Year'), ('country', 'Country')]\n",
    "value_dimensions = [('unem', 'Unemployment'), ('capmob', 'Capital Mobility'),\n",
    "                    ('gdp', 'GDP Growth'), ('trade', 'Trade')]\n",
    "macro = hv.Table(macro_df, key_dimensions, value_dimensions)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%output dpi=100\n",
    "%%opts Scatter [scaling_method='width' scaling_factor=2 size_index=2 show_grid=True] \n",
    "%%opts Scatter (color=Cycle('tab20') edgecolors='k')\n",
    "%%opts NdOverlay [legend_position='right' aspect=2, fig_size=250, show_frame=False]\n",
    "gdp_unem_scatter = macro.to.scatter('Year', ['GDP Growth', 'Unemployment'])\n",
    "gdp_unem_scatter.overlay('Country')"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
