{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Slider + Plotly Graph\n" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly\n", "from plotly.graph_objs import graph_objs as go\n", "from IPython.html.widgets import interact\n", "\n", "plotly.offline.init_notebook_mode()\n", "from plotly.offline import iplot\n", "def view_image(w):\n", " x_data = [1,2,3]\n", " x1 = [i+w for i in x_data]\n", " fig1 = go.Scatter(x=x1,y=[4,5,6])\n", " fig2 = go.Scatter(x=x_data,y=[4,5,6])\n", " iplot([fig1,fig2])\n", "interact(view_image, w=(0,100))\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }