Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tijptjik/465350a78432b31908b4 to your computer and use it in GitHub Desktop.
Save tijptjik/465350a78432b31908b4 to your computer and use it in GitHub Desktop.
{
"metadata": {
"name": "",
"signature": "sha256:5ad7f762e65176fc4319940032d1c0eb966cfa2b28c2b8cd558ad72236fbcdd8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<H2>nvd3 IPython integration demo</H2>\n",
"\n",
"For more information on nvd3, see https://github.com/areski/python-nvd3\n",
"\n",
"This notebook demonstrates simple ipython compatibility in the nvd3-python package, without making any\n",
"major modifications to how the main package is structured. It utilizes the IPython display-formatter functionality, as described at:\n",
"\n",
"http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/notebooks/Custom%20Display%20Logic.ipynb\n",
"\n",
"For additional examples, see:\n",
"\n",
"https://github.com/sympy/sympy/blob/master/sympy/interactive/printing.py\n",
"\n",
"Usage of nvd3-python in IPython notebook should be the same as any other IPython-aware display type. In any IPython interface which supports HTML views, nvd3-python will display nvd3 chart objects inline.\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import random\n",
"from IPython import display as d\n",
"import nvd3\n",
"nvd3.ipynb.initialize_javascript(use_remote=True)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"loaded nvd3 IPython extension\n",
"run nvd3.IPython_wrapper.initialize_javascript() to set up the notebook\n",
"help(nvd3.IPython_wrapper.initialize_javascript) for options\n"
]
},
{
"html": [
"<link media=\"all\" href=\"http://nvd3.org/assets/css/nv.d3.css\" type=\"text/css\" \n",
" rel=\"stylesheet\"/>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x10b59d510>"
]
},
{
"javascript": [
"$.getScript(\"http://nvd3.org/assets/js/nv.d3.js\")"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.Javascript at 0x10b59d510>"
]
},
{
"javascript": [
"$.getScript(\"http://nvd3.org/assets/lib/d3.v3.js\", function() {\n",
" $.getScript(\"http://nvd3.org/assets/js/nv.d3.js\", function() {})});"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.Javascript at 0x10b59d510>"
]
},
{
"html": [
"<script src=\"http://nvd3.org/assets/lib/d3.v3.js\"></script>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x10b59d510>"
]
},
{
"html": [
"<script src=\"http://nvd3.org/assets/js/nv.d3.js\"></script>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x10b59d510>"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that the javascript packages for display of nvd3 charts must be loaded into the IPython notebook before charts will display. By default, these are loaded from http://notebook-hostname:port/files/ - this is the default location where IPython 1.x serves files that are in the local working directory. For normal usage, the preferred approach is to download d3.v3.js, nv.d3.js, and nv.d3.css and place them in your notebook working directory.\n",
"\n",
"However, if we want the notebook to display correctly when using http://nbviewer.ipython.org we must point to remotely hosted versions of the nvd3 and d3 javascript and css files. Use_remote=true does just this, with the additional capability to individually define the URLs for each file (or use the defaults)."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"help(nvd3.ipynb.initialize_javascript)\n",
"nvd3.ipynb.initialize_javascript(use_remote=True)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Help on function initialize_javascript in module nvd3.ipynb:\n",
"\n",
"initialize_javascript(d3_js_url='http://nvd3.org/assets/lib/d3.v3.js', nvd3_js_url='http://nvd3.org/assets/js/nv.d3.js', nvd3_css_url='http://nvd3.org/assets/css/nv.d3.css', use_remote=False)\n",
" Initialize the ipython notebook to be able to display nvd3 results.\n",
" by instructing IPython to load the nvd3 JS and css files, and the d3 JS file.\n",
" \n",
" by default, it looks for the files in your IPython Notebook working directory.\n",
" \n",
" Takes the following options:\n",
" \n",
" use_remote: use remote hosts for d3.js, nvd3.js, and nv.d3.css (default False)\n",
" * Note: the following options are ignored if use_remote is False:\n",
" nvd3_css_url: location of nvd3 css file (default http://nvd3.org/assets/css/nv.d3.css)\n",
" nvd3_js_url: location of nvd3 javascript file (default http://nvd3.org/assets/js/nv.d3.js)\n",
" nvds_url: location of d3 javascript file (default http://nvd3.org/assets/lib/d3.v3.js)\n",
"\n"
]
},
{
"html": [
"<link media=\"all\" href=\"http://nvd3.org/assets/css/nv.d3.css\" type=\"text/css\" \n",
" rel=\"stylesheet\"/>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x10c41efd0>"
]
},
{
"javascript": [
"$.getScript(\"http://nvd3.org/assets/js/nv.d3.js\")"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.Javascript at 0x10c41efd0>"
]
},
{
"javascript": [
"$.getScript(\"http://nvd3.org/assets/lib/d3.v3.js\", function() {\n",
" $.getScript(\"http://nvd3.org/assets/js/nv.d3.js\", function() {})});"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.Javascript at 0x10c41efd0>"
]
},
{
"html": [
"<script src=\"http://nvd3.org/assets/lib/d3.v3.js\"></script>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x10c41efd0>"
]
},
{
"html": [
"<script src=\"http://nvd3.org/assets/js/nv.d3.js\"></script>"
],
"metadata": {},
"output_type": "display_data",
"text": [
"<IPython.core.display.HTML at 0x10c41efd0>"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"** Stacked Area Chart **\n",
"\n",
"Here, we create a simple stacked area chart.\n",
"\n",
"Note that there is a potential bug with ipython display of the interactive guideline - the amount of space <i>above</i> the chart affects the placement of the tooltip when viewed in IPython notebook. A simple workaround is to display the chart at the top of the notebook, rather than lower like we see here."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"type = 'stackedAreaChart'\n",
"chart2 = nvd3.stackedAreaChart(name=type,height=450,use_interactive_guideline=True)\n",
"nb_element = 50\n",
"xdata = range(nb_element)\n",
"ydata = [i * random.randint(1, 10) for i in range(nb_element)]\n",
"ydata2 = [x * 2 for x in ydata]\n",
"ydata3 = [x * 5 for x in ydata]\n",
"chart2.add_serie(name=\"serie 1\", y=ydata, x=xdata)\n",
"chart2.add_serie(name=\"serie 2\", y=ydata2, x=xdata)\n",
"chart2.add_serie(name=\"serie 3\", y=ydata3, x=xdata)\n",
"chart2\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div id=\"stackedAreaChart\"><svg style=\"height:450px;\"></svg></div>\n",
"\n",
"<script>\n",
" nv.addGraph(function() {\n",
" var chart = nv.models.stackedAreaChart().useInteractiveGuideline(true);\n",
" chart.margin({top: 30, right: 60, bottom: 20, left: 60})\n",
" chart.xAxis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.yAxis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.showLegend(true);\n",
" d3.select('#stackedAreaChart svg')\n",
" .datum(data_stackedAreaChart)\n",
" .transition().duration(500)\n",
" .attr('height', 450)\n",
" .call(chart);\n",
"\n",
" return chart;\n",
"});data_stackedAreaChart=[{\"values\": [{\"y\": 0, \"x\": 0}, {\"y\": 6, \"x\": 1}, {\"y\": 18, \"x\": 2}, {\"y\": 18, \"x\": 3}, {\"y\": 16, \"x\": 4}, {\"y\": 35, \"x\": 5}, {\"y\": 24, \"x\": 6}, {\"y\": 63, \"x\": 7}, {\"y\": 16, \"x\": 8}, {\"y\": 27, \"x\": 9}, {\"y\": 90, \"x\": 10}, {\"y\": 99, \"x\": 11}, {\"y\": 12, \"x\": 12}, {\"y\": 78, \"x\": 13}, {\"y\": 28, \"x\": 14}, {\"y\": 90, \"x\": 15}, {\"y\": 112, \"x\": 16}, {\"y\": 51, \"x\": 17}, {\"y\": 36, \"x\": 18}, {\"y\": 133, \"x\": 19}, {\"y\": 200, \"x\": 20}, {\"y\": 63, \"x\": 21}, {\"y\": 176, \"x\": 22}, {\"y\": 161, \"x\": 23}, {\"y\": 96, \"x\": 24}, {\"y\": 200, \"x\": 25}, {\"y\": 182, \"x\": 26}, {\"y\": 243, \"x\": 27}, {\"y\": 280, \"x\": 28}, {\"y\": 29, \"x\": 29}, {\"y\": 240, \"x\": 30}, {\"y\": 31, \"x\": 31}, {\"y\": 320, \"x\": 32}, {\"y\": 264, \"x\": 33}, {\"y\": 272, \"x\": 34}, {\"y\": 245, \"x\": 35}, {\"y\": 288, \"x\": 36}, {\"y\": 333, \"x\": 37}, {\"y\": 342, \"x\": 38}, {\"y\": 234, \"x\": 39}, {\"y\": 120, \"x\": 40}, {\"y\": 164, \"x\": 41}, {\"y\": 42, \"x\": 42}, {\"y\": 301, \"x\": 43}, {\"y\": 220, \"x\": 44}, {\"y\": 450, \"x\": 45}, {\"y\": 368, \"x\": 46}, {\"y\": 94, \"x\": 47}, {\"y\": 480, \"x\": 48}, {\"y\": 490, \"x\": 49}], \"key\": \"serie 1\", \"yAxis\": \"1\"}, {\"values\": [{\"y\": 0, \"x\": 0}, {\"y\": 12, \"x\": 1}, {\"y\": 36, \"x\": 2}, {\"y\": 36, \"x\": 3}, {\"y\": 32, \"x\": 4}, {\"y\": 70, \"x\": 5}, {\"y\": 48, \"x\": 6}, {\"y\": 126, \"x\": 7}, {\"y\": 32, \"x\": 8}, {\"y\": 54, \"x\": 9}, {\"y\": 180, \"x\": 10}, {\"y\": 198, \"x\": 11}, {\"y\": 24, \"x\": 12}, {\"y\": 156, \"x\": 13}, {\"y\": 56, \"x\": 14}, {\"y\": 180, \"x\": 15}, {\"y\": 224, \"x\": 16}, {\"y\": 102, \"x\": 17}, {\"y\": 72, \"x\": 18}, {\"y\": 266, \"x\": 19}, {\"y\": 400, \"x\": 20}, {\"y\": 126, \"x\": 21}, {\"y\": 352, \"x\": 22}, {\"y\": 322, \"x\": 23}, {\"y\": 192, \"x\": 24}, {\"y\": 400, \"x\": 25}, {\"y\": 364, \"x\": 26}, {\"y\": 486, \"x\": 27}, {\"y\": 560, \"x\": 28}, {\"y\": 58, \"x\": 29}, {\"y\": 480, \"x\": 30}, {\"y\": 62, \"x\": 31}, {\"y\": 640, \"x\": 32}, {\"y\": 528, \"x\": 33}, {\"y\": 544, \"x\": 34}, {\"y\": 490, \"x\": 35}, {\"y\": 576, \"x\": 36}, {\"y\": 666, \"x\": 37}, {\"y\": 684, \"x\": 38}, {\"y\": 468, \"x\": 39}, {\"y\": 240, \"x\": 40}, {\"y\": 328, \"x\": 41}, {\"y\": 84, \"x\": 42}, {\"y\": 602, \"x\": 43}, {\"y\": 440, \"x\": 44}, {\"y\": 900, \"x\": 45}, {\"y\": 736, \"x\": 46}, {\"y\": 188, \"x\": 47}, {\"y\": 960, \"x\": 48}, {\"y\": 980, \"x\": 49}], \"key\": \"serie 2\", \"yAxis\": \"1\"}, {\"values\": [{\"y\": 0, \"x\": 0}, {\"y\": 30, \"x\": 1}, {\"y\": 90, \"x\": 2}, {\"y\": 90, \"x\": 3}, {\"y\": 80, \"x\": 4}, {\"y\": 175, \"x\": 5}, {\"y\": 120, \"x\": 6}, {\"y\": 315, \"x\": 7}, {\"y\": 80, \"x\": 8}, {\"y\": 135, \"x\": 9}, {\"y\": 450, \"x\": 10}, {\"y\": 495, \"x\": 11}, {\"y\": 60, \"x\": 12}, {\"y\": 390, \"x\": 13}, {\"y\": 140, \"x\": 14}, {\"y\": 450, \"x\": 15}, {\"y\": 560, \"x\": 16}, {\"y\": 255, \"x\": 17}, {\"y\": 180, \"x\": 18}, {\"y\": 665, \"x\": 19}, {\"y\": 1000, \"x\": 20}, {\"y\": 315, \"x\": 21}, {\"y\": 880, \"x\": 22}, {\"y\": 805, \"x\": 23}, {\"y\": 480, \"x\": 24}, {\"y\": 1000, \"x\": 25}, {\"y\": 910, \"x\": 26}, {\"y\": 1215, \"x\": 27}, {\"y\": 1400, \"x\": 28}, {\"y\": 145, \"x\": 29}, {\"y\": 1200, \"x\": 30}, {\"y\": 155, \"x\": 31}, {\"y\": 1600, \"x\": 32}, {\"y\": 1320, \"x\": 33}, {\"y\": 1360, \"x\": 34}, {\"y\": 1225, \"x\": 35}, {\"y\": 1440, \"x\": 36}, {\"y\": 1665, \"x\": 37}, {\"y\": 1710, \"x\": 38}, {\"y\": 1170, \"x\": 39}, {\"y\": 600, \"x\": 40}, {\"y\": 820, \"x\": 41}, {\"y\": 210, \"x\": 42}, {\"y\": 1505, \"x\": 43}, {\"y\": 1100, \"x\": 44}, {\"y\": 2250, \"x\": 45}, {\"y\": 1840, \"x\": 46}, {\"y\": 470, \"x\": 47}, {\"y\": 2400, \"x\": 48}, {\"y\": 2450, \"x\": 49}], \"key\": \"serie 3\", \"yAxis\": \"1\"}];\n",
"</script>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"text": [
"<nvd3.stackedAreaChart.stackedAreaChart instance at 0x10b586ef0>"
]
}
],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"chart = nvd3.scatterChart(name='scatterChart_1', width=600, height=300, x_is_date=False)\n",
"nb_element = 50\n",
"xdata = [i + random.randint(1, 10) for i in range(nb_element)]\n",
"ydata = [i * random.randint(1, 10) for i in range(nb_element)]\n",
"ydata2 = [x * 2 for x in ydata]\n",
"ydata3 = [x * 5 for x in ydata]\n",
"\n",
"kwargs1 = {'shape': 'circle', 'size': '1'}\n",
"kwargs2 = {'shape': 'cross', 'size': '10'}\n",
"kwargs3 = {'shape': 'triangle-up', 'size': '100'}\n",
"\n",
"extra_serie = {\"tooltip\": {\"y_start\": \"\", \"y_end\": \" calls\"}}\n",
"chart.add_serie(name=\"serie 1\", y=ydata, x=xdata, extra=extra_serie, **kwargs1)\n",
"chart.add_serie(name=\"serie 2\", y=ydata2, x=xdata, extra=extra_serie, **kwargs2)\n",
"chart.add_serie(name=\"serie 3\", y=ydata3, x=xdata, extra=extra_serie, **kwargs3)\n",
"chart"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div id=\"scatterChart_1\"><svg style=\"width:600px;height:300px;\"></svg></div>\n",
"\n",
"<script>\n",
" nv.addGraph(function() {\n",
" var chart = nv.models.scatterChart()\n",
" .showDistX(true)\n",
" .showDistY(true)\n",
" .color(d3.scale.category10().range());\n",
" chart.margin({top: 30, right: 60, bottom: 20, left: 60})\n",
" chart.xAxis\n",
" .tickFormat(d3.format(',.02f'));\n",
" chart.yAxis\n",
" .tickFormat(d3.format(',.02f'));\n",
" chart.tooltipContent(function(key, y, e, graph) {\n",
" var x = String(graph.point.x);\n",
" var y = String(graph.point.y);\n",
" if(key == 'serie 1'){\n",
" var y = String(graph.point.y) + ' calls';\n",
" }\n",
" if(key == 'serie 2'){\n",
" var y = String(graph.point.y) + ' calls';\n",
" }\n",
" if(key == 'serie 3'){\n",
" var y = String(graph.point.y) + ' calls';\n",
" }\n",
" tooltip_str = '<center><b>'+key+'</b></center>' + y + ' at ' + x;\n",
" return tooltip_str;\n",
" });\n",
"chart.scatter.onlyCircles(false); chart.showLegend(true);\n",
" d3.select('#scatterChart_1 svg')\n",
" .datum(data_scatterChart_1)\n",
" .transition().duration(500)\n",
" .attr('width', 600)\n",
".attr('height', 300)\n",
" .call(chart);\n",
"\n",
" return chart;\n",
"});data_scatterChart_1=[{\"values\": [{\"y\": 0, \"x\": 10, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 6, \"x\": 11, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 20, \"x\": 9, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 3, \"x\": 13, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 40, \"x\": 13, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 15, \"x\": 12, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 30, \"x\": 13, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 35, \"x\": 14, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 40, \"x\": 14, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 72, \"x\": 14, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 20, \"x\": 20, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 33, \"x\": 13, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 12, \"x\": 14, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 13, \"x\": 23, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 140, \"x\": 21, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 60, \"x\": 25, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 48, \"x\": 21, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 51, \"x\": 19, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 90, \"x\": 26, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 114, \"x\": 25, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 140, \"x\": 30, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 105, \"x\": 23, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 88, \"x\": 32, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 161, \"x\": 27, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 144, \"x\": 34, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 25, \"x\": 30, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 208, \"x\": 34, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 243, \"x\": 29, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 280, \"x\": 30, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 290, \"x\": 35, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 210, \"x\": 31, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 155, \"x\": 37, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 64, \"x\": 33, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 198, \"x\": 41, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 204, \"x\": 40, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 315, \"x\": 44, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 360, \"x\": 41, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 148, \"x\": 40, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 152, \"x\": 43, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 39, \"x\": 43, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 320, \"x\": 44, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 123, \"x\": 50, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 336, \"x\": 50, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 43, \"x\": 49, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 308, \"x\": 53, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 315, \"x\": 54, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 92, \"x\": 51, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 235, \"x\": 48, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 336, \"x\": 57, \"shape\": \"circle\", \"size\": \"1\"}, {\"y\": 196, \"x\": 50, \"shape\": \"circle\", \"size\": \"1\"}], \"key\": \"serie 1\", \"yAxis\": \"1\"}, {\"values\": [{\"y\": 0, \"x\": 10, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 12, \"x\": 11, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 40, \"x\": 9, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 6, \"x\": 13, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 80, \"x\": 13, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 30, \"x\": 12, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 60, \"x\": 13, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 70, \"x\": 14, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 80, \"x\": 14, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 144, \"x\": 14, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 40, \"x\": 20, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 66, \"x\": 13, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 24, \"x\": 14, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 26, \"x\": 23, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 280, \"x\": 21, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 120, \"x\": 25, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 96, \"x\": 21, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 102, \"x\": 19, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 180, \"x\": 26, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 228, \"x\": 25, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 280, \"x\": 30, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 210, \"x\": 23, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 176, \"x\": 32, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 322, \"x\": 27, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 288, \"x\": 34, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 50, \"x\": 30, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 416, \"x\": 34, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 486, \"x\": 29, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 560, \"x\": 30, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 580, \"x\": 35, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 420, \"x\": 31, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 310, \"x\": 37, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 128, \"x\": 33, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 396, \"x\": 41, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 408, \"x\": 40, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 630, \"x\": 44, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 720, \"x\": 41, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 296, \"x\": 40, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 304, \"x\": 43, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 78, \"x\": 43, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 640, \"x\": 44, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 246, \"x\": 50, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 672, \"x\": 50, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 86, \"x\": 49, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 616, \"x\": 53, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 630, \"x\": 54, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 184, \"x\": 51, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 470, \"x\": 48, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 672, \"x\": 57, \"shape\": \"cross\", \"size\": \"10\"}, {\"y\": 392, \"x\": 50, \"shape\": \"cross\", \"size\": \"10\"}], \"key\": \"serie 2\", \"yAxis\": \"1\"}, {\"values\": [{\"y\": 0, \"x\": 10, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 30, \"x\": 11, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 100, \"x\": 9, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 15, \"x\": 13, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 200, \"x\": 13, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 75, \"x\": 12, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 150, \"x\": 13, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 175, \"x\": 14, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 200, \"x\": 14, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 360, \"x\": 14, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 100, \"x\": 20, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 165, \"x\": 13, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 60, \"x\": 14, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 65, \"x\": 23, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 700, \"x\": 21, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 300, \"x\": 25, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 240, \"x\": 21, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 255, \"x\": 19, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 450, \"x\": 26, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 570, \"x\": 25, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 700, \"x\": 30, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 525, \"x\": 23, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 440, \"x\": 32, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 805, \"x\": 27, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 720, \"x\": 34, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 125, \"x\": 30, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1040, \"x\": 34, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1215, \"x\": 29, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1400, \"x\": 30, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1450, \"x\": 35, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1050, \"x\": 31, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 775, \"x\": 37, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 320, \"x\": 33, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 990, \"x\": 41, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1020, \"x\": 40, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1575, \"x\": 44, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1800, \"x\": 41, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 740, \"x\": 40, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 760, \"x\": 43, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 195, \"x\": 43, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1600, \"x\": 44, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 615, \"x\": 50, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1680, \"x\": 50, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 215, \"x\": 49, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1540, \"x\": 53, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1575, \"x\": 54, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 460, \"x\": 51, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1175, \"x\": 48, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 1680, \"x\": 57, \"shape\": \"triangle-up\", \"size\": \"100\"}, {\"y\": 980, \"x\": 50, \"shape\": \"triangle-up\", \"size\": \"100\"}], \"key\": \"serie 3\", \"yAxis\": \"1\"}];\n",
"</script>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"text": [
"<nvd3.scatterChart.scatterChart instance at 0x10c42add0>"
]
}
],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"type = 'pieChart'\n",
"chart1 = nvd3.pieChart(name=type, color_category='category20c', height=450, width=450)\n",
"chart1.set_containerheader(\"\\n\\n<h2>\" + type + \"</h2>\\n\\n\")\n",
"\n",
"#Create the keys\n",
"xdata = [\"Orange\", \"Banana\", \"Pear\", \"Kiwi\", \"Apple\", \"Strawberry\", \"Pineapple\"]\n",
"ydata = [3, 4, 0, 1, 5, 7, 3]\n",
"\n",
"#Add the serie\n",
"extra_serie = {\"tooltip\": {\"y_start\": \"\", \"y_end\": \" cal\"}}\n",
"chart1.add_serie(y=ydata, x=xdata, extra=extra_serie)\n",
"chart1"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"\n",
"\n",
"<h2>pieChart</h2>\n",
"\n",
"<div id=\"pieChart\"><svg style=\"width:450px;height:450px;\"></svg></div>\n",
"\n",
"<script>\n",
" nv.addGraph(function() {\n",
" var chart = nv.models.pieChart();\n",
" chart.x(function(d) { return d.label })\n",
" .y(function(d) { return d.value });\n",
" chart.width(450);\n",
" chart.height(450);\n",
"\n",
" chart.margin({top: 30, right: 60, bottom: 20, left: 60})\n",
" chart.tooltipContent(function(key, y, e, graph) {\n",
" var x = String(key);\n",
" var y = String(y) + ' cal';\n",
" tooltip_str = '<center><b>'+x+'</b></center>' + y;\n",
" return tooltip_str;\n",
" });\n",
" chart.showLegend(true);\n",
" chart.showLabels(true);\n",
" d3.select('#pieChart svg')\n",
" .datum(data_pieChart[0].values)\n",
" .transition().duration(500)\n",
" .attr('width', 450)\n",
".attr('height', 450)\n",
" .call(chart);\n",
"\n",
" return chart;\n",
"});data_pieChart=[{\"values\": [{\"value\": 3, \"label\": \"Orange\"}, {\"value\": 4, \"label\": \"Banana\"}, {\"value\": 0, \"label\": \"Pear\"}, {\"value\": 1, \"label\": \"Kiwi\"}, {\"value\": 5, \"label\": \"Apple\"}, {\"value\": 7, \"label\": \"Strawberry\"}, {\"value\": 3, \"label\": \"Pineapple\"}], \"key\": \"Serie 1\"}];\n",
"</script>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"text": [
"<nvd3.pieChart.pieChart instance at 0x10b5869e0>"
]
}
],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"chart3=nvd3.lineWithFocusChart(name=\"focusChart\",height=450)\n",
"nb_element = 100\n",
"xdata = range(nb_element)\n",
"ydata = [i * random.randint(1, 10) for i in range(nb_element)]\n",
"chart3.add_serie(x=xdata,y=ydata,name=\"random data\")\n",
"chart3"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div id=\"focusChart\"><svg style=\"height:450px;\"></svg></div>\n",
"\n",
"<script>\n",
" nv.addGraph(function() {\n",
" var chart = nv.models.lineWithFocusChart();\n",
" chart.margin({top: 30, right: 60, bottom: 20, left: 60})\n",
" chart.yAxis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.y2Axis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.xAxis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.x2Axis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.showLegend(true);\n",
" d3.select('#focusChart svg')\n",
" .datum(data_focusChart)\n",
" .transition().duration(500)\n",
" .attr('height', 450)\n",
" .call(chart);\n",
"\n",
" return chart;\n",
"});data_focusChart=[{\"values\": [{\"y\": 0, \"x\": 0}, {\"y\": 3, \"x\": 1}, {\"y\": 2, \"x\": 2}, {\"y\": 9, \"x\": 3}, {\"y\": 20, \"x\": 4}, {\"y\": 30, \"x\": 5}, {\"y\": 12, \"x\": 6}, {\"y\": 28, \"x\": 7}, {\"y\": 8, \"x\": 8}, {\"y\": 72, \"x\": 9}, {\"y\": 10, \"x\": 10}, {\"y\": 110, \"x\": 11}, {\"y\": 36, \"x\": 12}, {\"y\": 13, \"x\": 13}, {\"y\": 14, \"x\": 14}, {\"y\": 105, \"x\": 15}, {\"y\": 96, \"x\": 16}, {\"y\": 153, \"x\": 17}, {\"y\": 18, \"x\": 18}, {\"y\": 152, \"x\": 19}, {\"y\": 120, \"x\": 20}, {\"y\": 126, \"x\": 21}, {\"y\": 132, \"x\": 22}, {\"y\": 184, \"x\": 23}, {\"y\": 144, \"x\": 24}, {\"y\": 200, \"x\": 25}, {\"y\": 182, \"x\": 26}, {\"y\": 108, \"x\": 27}, {\"y\": 252, \"x\": 28}, {\"y\": 290, \"x\": 29}, {\"y\": 210, \"x\": 30}, {\"y\": 155, \"x\": 31}, {\"y\": 224, \"x\": 32}, {\"y\": 198, \"x\": 33}, {\"y\": 68, \"x\": 34}, {\"y\": 280, \"x\": 35}, {\"y\": 36, \"x\": 36}, {\"y\": 333, \"x\": 37}, {\"y\": 266, \"x\": 38}, {\"y\": 234, \"x\": 39}, {\"y\": 40, \"x\": 40}, {\"y\": 164, \"x\": 41}, {\"y\": 42, \"x\": 42}, {\"y\": 43, \"x\": 43}, {\"y\": 308, \"x\": 44}, {\"y\": 270, \"x\": 45}, {\"y\": 46, \"x\": 46}, {\"y\": 235, \"x\": 47}, {\"y\": 48, \"x\": 48}, {\"y\": 441, \"x\": 49}, {\"y\": 50, \"x\": 50}, {\"y\": 408, \"x\": 51}, {\"y\": 312, \"x\": 52}, {\"y\": 106, \"x\": 53}, {\"y\": 216, \"x\": 54}, {\"y\": 275, \"x\": 55}, {\"y\": 280, \"x\": 56}, {\"y\": 570, \"x\": 57}, {\"y\": 348, \"x\": 58}, {\"y\": 413, \"x\": 59}, {\"y\": 240, \"x\": 60}, {\"y\": 488, \"x\": 61}, {\"y\": 620, \"x\": 62}, {\"y\": 504, \"x\": 63}, {\"y\": 512, \"x\": 64}, {\"y\": 390, \"x\": 65}, {\"y\": 330, \"x\": 66}, {\"y\": 469, \"x\": 67}, {\"y\": 136, \"x\": 68}, {\"y\": 483, \"x\": 69}, {\"y\": 70, \"x\": 70}, {\"y\": 213, \"x\": 71}, {\"y\": 360, \"x\": 72}, {\"y\": 146, \"x\": 73}, {\"y\": 148, \"x\": 74}, {\"y\": 450, \"x\": 75}, {\"y\": 152, \"x\": 76}, {\"y\": 539, \"x\": 77}, {\"y\": 702, \"x\": 78}, {\"y\": 553, \"x\": 79}, {\"y\": 240, \"x\": 80}, {\"y\": 810, \"x\": 81}, {\"y\": 328, \"x\": 82}, {\"y\": 664, \"x\": 83}, {\"y\": 252, \"x\": 84}, {\"y\": 680, \"x\": 85}, {\"y\": 774, \"x\": 86}, {\"y\": 261, \"x\": 87}, {\"y\": 792, \"x\": 88}, {\"y\": 534, \"x\": 89}, {\"y\": 180, \"x\": 90}, {\"y\": 182, \"x\": 91}, {\"y\": 920, \"x\": 92}, {\"y\": 837, \"x\": 93}, {\"y\": 940, \"x\": 94}, {\"y\": 475, \"x\": 95}, {\"y\": 192, \"x\": 96}, {\"y\": 679, \"x\": 97}, {\"y\": 882, \"x\": 98}, {\"y\": 891, \"x\": 99}], \"key\": \"random data\", \"yAxis\": \"1\"}];\n",
"</script>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 6,
"text": [
"<nvd3.lineWithFocusChart.lineWithFocusChart instance at 0x10b58de18>"
]
}
],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy\n",
"chart4 = nvd3.multiBarChart(name=\"multiBarChart\",height=450)\n",
"max_value = 8\n",
"data1 = numpy.random.normal(loc=max_value/2,scale=max_value/6,size=1000)\n",
"hist1 = numpy.histogram(data1,bins=100)\n",
"xdata1 = hist1[1].tolist()\n",
"ydata1 = hist1[0].tolist()\n",
"\n",
"data2 = numpy.random.gamma(shape=2., scale=1., size=1000)\n",
"hist2 = numpy.histogram(data2,bins=xdata1)\n",
"xdata2 = hist2[1].tolist()\n",
"ydata2 = hist2[0].tolist()\n",
"chart4.add_serie(x=xdata1,y=ydata1,name=\"Normal Distribution\")\n",
"chart4.add_serie(x=xdata2,y=ydata2,name=\"Gamma Distribution\")\n",
"chart4"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div id=\"multiBarChart\"><svg style=\"height:450px;\"></svg></div>\n",
"\n",
"<script>\n",
" nv.addGraph(function() {\n",
" var chart = nv.models.multiBarChart();\n",
" chart.margin({top: 30, right: 60, bottom: 20, left: 60})\n",
" chart.xAxis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.yAxis\n",
" .tickFormat(d3.format(',.2f'));\n",
" chart.showLegend(true);\n",
" d3.select('#multiBarChart svg')\n",
" .datum(data_multiBarChart)\n",
" .transition().duration(500)\n",
" .attr('height', 450)\n",
" .call(chart);\n",
"\n",
" return chart;\n",
"});data_multiBarChart=[{\"values\": [{\"y\": 1, \"x\": 0.927425319820153}, {\"y\": 0, \"x\": 0.9914769378994736}, {\"y\": 0, \"x\": 1.0555285559787941}, {\"y\": 2, \"x\": 1.1195801740581148}, {\"y\": 1, \"x\": 1.1836317921374353}, {\"y\": 0, \"x\": 1.247683410216756}, {\"y\": 0, \"x\": 1.3117350282960767}, {\"y\": 1, \"x\": 1.3757866463753972}, {\"y\": 1, \"x\": 1.4398382644547176}, {\"y\": 1, \"x\": 1.5038898825340383}, {\"y\": 1, \"x\": 1.567941500613359}, {\"y\": 2, \"x\": 1.6319931186926795}, {\"y\": 3, \"x\": 1.6960447367720002}, {\"y\": 5, \"x\": 1.7600963548513207}, {\"y\": 2, \"x\": 1.8241479729306413}, {\"y\": 3, \"x\": 1.888199591009962}, {\"y\": 3, \"x\": 1.9522512090892825}, {\"y\": 2, \"x\": 2.0163028271686034}, {\"y\": 5, \"x\": 2.0803544452479237}, {\"y\": 5, \"x\": 2.1444060633272444}, {\"y\": 7, \"x\": 2.208457681406565}, {\"y\": 6, \"x\": 2.2725092994858853}, {\"y\": 5, \"x\": 2.336560917565206}, {\"y\": 8, \"x\": 2.4006125356445267}, {\"y\": 5, \"x\": 2.4646641537238474}, {\"y\": 14, \"x\": 2.528715771803168}, {\"y\": 13, \"x\": 2.5927673898824883}, {\"y\": 7, \"x\": 2.656819007961809}, {\"y\": 11, \"x\": 2.7208706260411297}, {\"y\": 15, \"x\": 2.78492224412045}, {\"y\": 10, \"x\": 2.848973862199771}, {\"y\": 13, \"x\": 2.9130254802790914}, {\"y\": 24, \"x\": 2.977077098358412}, {\"y\": 21, \"x\": 3.0411287164377327}, {\"y\": 25, \"x\": 3.1051803345170534}, {\"y\": 24, \"x\": 3.1692319525963737}, {\"y\": 16, \"x\": 3.2332835706756944}, {\"y\": 23, \"x\": 3.297335188755015}, {\"y\": 25, \"x\": 3.3613868068343358}, {\"y\": 18, \"x\": 3.425438424913656}, {\"y\": 30, \"x\": 3.4894900429929767}, {\"y\": 17, \"x\": 3.5535416610722974}, {\"y\": 29, \"x\": 3.617593279151618}, {\"y\": 21, \"x\": 3.681644897230939}, {\"y\": 23, \"x\": 3.745696515310259}, {\"y\": 21, \"x\": 3.8097481333895797}, {\"y\": 22, \"x\": 3.8737997514689004}, {\"y\": 28, \"x\": 3.937851369548221}, {\"y\": 28, \"x\": 4.001902987627542}, {\"y\": 20, \"x\": 4.065954605706862}, {\"y\": 25, \"x\": 4.130006223786182}, {\"y\": 26, \"x\": 4.1940578418655035}, {\"y\": 22, \"x\": 4.258109459944825}, {\"y\": 27, \"x\": 4.322161078024145}, {\"y\": 22, \"x\": 4.386212696103465}, {\"y\": 18, \"x\": 4.450264314182785}, {\"y\": 21, \"x\": 4.5143159322621065}, {\"y\": 22, \"x\": 4.578367550341428}, {\"y\": 23, \"x\": 4.642419168420748}, {\"y\": 12, \"x\": 4.706470786500068}, {\"y\": 13, \"x\": 4.770522404579388}, {\"y\": 19, \"x\": 4.8345740226587095}, {\"y\": 15, \"x\": 4.89862564073803}, {\"y\": 22, \"x\": 4.962677258817351}, {\"y\": 12, \"x\": 5.026728876896671}, {\"y\": 8, \"x\": 5.090780494975991}, {\"y\": 15, \"x\": 5.1548321130553125}, {\"y\": 14, \"x\": 5.218883731134633}, {\"y\": 8, \"x\": 5.282935349213954}, {\"y\": 10, \"x\": 5.346986967293274}, {\"y\": 7, \"x\": 5.411038585372594}, {\"y\": 6, \"x\": 5.4750902034519155}, {\"y\": 10, \"x\": 5.539141821531236}, {\"y\": 9, \"x\": 5.603193439610557}, {\"y\": 7, \"x\": 5.667245057689877}, {\"y\": 5, \"x\": 5.731296675769197}, {\"y\": 5, \"x\": 5.795348293848519}, {\"y\": 3, \"x\": 5.859399911927839}, {\"y\": 5, \"x\": 5.923451530007159}, {\"y\": 2, \"x\": 5.98750314808648}, {\"y\": 2, \"x\": 6.0515547661658005}, {\"y\": 5, \"x\": 6.115606384245122}, {\"y\": 0, \"x\": 6.179658002324442}, {\"y\": 1, \"x\": 6.243709620403762}, {\"y\": 2, \"x\": 6.307761238483083}, {\"y\": 1, \"x\": 6.3718128565624035}, {\"y\": 1, \"x\": 6.435864474641725}, {\"y\": 1, \"x\": 6.499916092721045}, {\"y\": 0, \"x\": 6.563967710800365}, {\"y\": 3, \"x\": 6.628019328879686}, {\"y\": 0, \"x\": 6.6920709469590065}, {\"y\": 0, \"x\": 6.756122565038328}, {\"y\": 2, \"x\": 6.820174183117648}, {\"y\": 0, \"x\": 6.884225801196968}, {\"y\": 0, \"x\": 6.948277419276289}, {\"y\": 1, \"x\": 7.0123290373556095}, {\"y\": 0, \"x\": 7.076380655434931}, {\"y\": 0, \"x\": 7.140432273514251}, {\"y\": 0, \"x\": 7.204483891593571}, {\"y\": 1, \"x\": 7.268535509672892}], \"key\": \"Normal Distribution\", \"yAxis\": \"1\"}, {\"values\": [{\"y\": 26, \"x\": 0.927425319820153}, {\"y\": 26, \"x\": 0.9914769378994736}, {\"y\": 23, \"x\": 1.0555285559787941}, {\"y\": 14, \"x\": 1.1195801740581148}, {\"y\": 13, \"x\": 1.1836317921374353}, {\"y\": 38, \"x\": 1.247683410216756}, {\"y\": 23, \"x\": 1.3117350282960767}, {\"y\": 14, \"x\": 1.3757866463753972}, {\"y\": 17, \"x\": 1.4398382644547176}, {\"y\": 23, \"x\": 1.5038898825340383}, {\"y\": 25, \"x\": 1.567941500613359}, {\"y\": 17, \"x\": 1.6319931186926795}, {\"y\": 18, \"x\": 1.6960447367720002}, {\"y\": 27, \"x\": 1.7600963548513207}, {\"y\": 17, \"x\": 1.8241479729306413}, {\"y\": 15, \"x\": 1.888199591009962}, {\"y\": 23, \"x\": 1.9522512090892825}, {\"y\": 15, \"x\": 2.0163028271686034}, {\"y\": 15, \"x\": 2.0803544452479237}, {\"y\": 10, \"x\": 2.1444060633272444}, {\"y\": 15, \"x\": 2.208457681406565}, {\"y\": 11, \"x\": 2.2725092994858853}, {\"y\": 16, \"x\": 2.336560917565206}, {\"y\": 11, \"x\": 2.4006125356445267}, {\"y\": 12, \"x\": 2.4646641537238474}, {\"y\": 9, \"x\": 2.528715771803168}, {\"y\": 13, \"x\": 2.5927673898824883}, {\"y\": 18, \"x\": 2.656819007961809}, {\"y\": 16, \"x\": 2.7208706260411297}, {\"y\": 14, \"x\": 2.78492224412045}, {\"y\": 7, \"x\": 2.848973862199771}, {\"y\": 4, \"x\": 2.9130254802790914}, {\"y\": 7, \"x\": 2.977077098358412}, {\"y\": 9, \"x\": 3.0411287164377327}, {\"y\": 12, \"x\": 3.1051803345170534}, {\"y\": 7, \"x\": 3.1692319525963737}, {\"y\": 5, \"x\": 3.2332835706756944}, {\"y\": 10, \"x\": 3.297335188755015}, {\"y\": 5, \"x\": 3.3613868068343358}, {\"y\": 10, \"x\": 3.425438424913656}, {\"y\": 11, \"x\": 3.4894900429929767}, {\"y\": 12, \"x\": 3.5535416610722974}, {\"y\": 5, \"x\": 3.617593279151618}, {\"y\": 6, \"x\": 3.681644897230939}, {\"y\": 6, \"x\": 3.745696515310259}, {\"y\": 7, \"x\": 3.8097481333895797}, {\"y\": 6, \"x\": 3.8737997514689004}, {\"y\": 8, \"x\": 3.937851369548221}, {\"y\": 6, \"x\": 4.001902987627542}, {\"y\": 3, \"x\": 4.065954605706862}, {\"y\": 4, \"x\": 4.130006223786182}, {\"y\": 5, \"x\": 4.1940578418655035}, {\"y\": 1, \"x\": 4.258109459944825}, {\"y\": 3, \"x\": 4.322161078024145}, {\"y\": 5, \"x\": 4.386212696103465}, {\"y\": 4, \"x\": 4.450264314182785}, {\"y\": 1, \"x\": 4.5143159322621065}, {\"y\": 5, \"x\": 4.578367550341428}, {\"y\": 2, \"x\": 4.642419168420748}, {\"y\": 1, \"x\": 4.706470786500068}, {\"y\": 1, \"x\": 4.770522404579388}, {\"y\": 1, \"x\": 4.8345740226587095}, {\"y\": 3, \"x\": 4.89862564073803}, {\"y\": 0, \"x\": 4.962677258817351}, {\"y\": 1, \"x\": 5.026728876896671}, {\"y\": 4, \"x\": 5.090780494975991}, {\"y\": 0, \"x\": 5.1548321130553125}, {\"y\": 3, \"x\": 5.218883731134633}, {\"y\": 2, \"x\": 5.282935349213954}, {\"y\": 2, \"x\": 5.346986967293274}, {\"y\": 0, \"x\": 5.411038585372594}, {\"y\": 1, \"x\": 5.4750902034519155}, {\"y\": 4, \"x\": 5.539141821531236}, {\"y\": 3, \"x\": 5.603193439610557}, {\"y\": 1, \"x\": 5.667245057689877}, {\"y\": 2, \"x\": 5.731296675769197}, {\"y\": 0, \"x\": 5.795348293848519}, {\"y\": 1, \"x\": 5.859399911927839}, {\"y\": 2, \"x\": 5.923451530007159}, {\"y\": 1, \"x\": 5.98750314808648}, {\"y\": 1, \"x\": 6.0515547661658005}, {\"y\": 1, \"x\": 6.115606384245122}, {\"y\": 0, \"x\": 6.179658002324442}, {\"y\": 3, \"x\": 6.243709620403762}, {\"y\": 0, \"x\": 6.307761238483083}, {\"y\": 2, \"x\": 6.3718128565624035}, {\"y\": 1, \"x\": 6.435864474641725}, {\"y\": 2, \"x\": 6.499916092721045}, {\"y\": 1, \"x\": 6.563967710800365}, {\"y\": 0, \"x\": 6.628019328879686}, {\"y\": 1, \"x\": 6.6920709469590065}, {\"y\": 0, \"x\": 6.756122565038328}, {\"y\": 0, \"x\": 6.820174183117648}, {\"y\": 1, \"x\": 6.884225801196968}, {\"y\": 0, \"x\": 6.948277419276289}, {\"y\": 0, \"x\": 7.0123290373556095}, {\"y\": 0, \"x\": 7.076380655434931}, {\"y\": 0, \"x\": 7.140432273514251}, {\"y\": 0, \"x\": 7.204483891593571}, {\"y\": 0, \"x\": 7.268535509672892}], \"key\": \"Gamma Distribution\", \"yAxis\": \"1\"}];\n",
"</script>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 7,
"text": [
"<nvd3.multiBarChart.multiBarChart instance at 0x10c438ef0>"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment