Sha256: f60a48f81020827fe908ceab191fe6d1a6791ecd4719e59c2b847ca4927355f5
Contents?: true
Size: 1.95 KB
Versions: 25
Compression:
Stored size: 1.95 KB
Contents
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import nbinteract as nbi\n", "import numpy as np\n", "from numpy import arange" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "2a3ec49c193d4c989bc03565640b1853", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(interactive(children=(IntSlider(value=30, description='max', max=50, min=10), IntSlider(value=5…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def x_fn(max):\n", " return np.arange(0, max + 1)\n", "\n", "def y_fn(xs, noise):\n", " return xs + np.random.normal(0, scale=noise, size=len(xs))\n", "\n", "\n", "options = {\n", " 'title': 'Line chart',\n", " 'xlabel': 'x-values (max)',\n", " 'ylabel': 'y-values (noise)', \n", " 'xlim': (0, 50),\n", " 'ylim': (-20, 70),\n", " 'animation_duration': 500\n", "}\n", "\n", "layouts = {\n", " 'plot_height': '480px',\n", " 'plot_width': '800px',\n", "}\n", "\n", "line_chart = nbi.line(\n", " x_fn,\n", " y_fn,\n", " max=(10, 50),\n", " noise=(0, 10),\n", " options=options,\n", " layouts=layouts\n", ")\n", "\n", "line_chart" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "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.7.9" } }, "nbformat": 4, "nbformat_minor": 4 }
Version data entries
25 entries across 19 versions & 1 rubygems