{ "metadata": { "name": "", "signature": "sha256:4b548f2f714e876694d622abfe6e11b66939983f1f2d4f74c1378796ffc072ca" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Plotly 3d sub-scenes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import plotly\n", "plotly.__version__" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 1, "text": [ "'1.4.7'" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "import plotly.plotly as py # sign in with your credentials file\n", "import plotly.tools as tls\n", "from plotly.graph_objs import *" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "def get_random_data(N):\n", " return np.random.random(N), np.random.random(N), np.random.random(N)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "N = 40\n", "\n", "x1, y1, z1 = get_random_data(N)\n", "trace1 = Scatter3d(\n", " x=x1,\n", " y=y1,\n", " z=z1,\n", " mode='markers',\n", " scene='scene1'\n", ")\n", "\n", "x2, y2, z2 = get_random_data(N)\n", "trace2 = Scatter3d(\n", " x=x2,\n", " y=y2,\n", " z=z2,\n", " mode='markers',\n", " scene='scene2'\n", ")\n", "\n", "data = Data([trace1, trace2])\n", "\n", "layout = Layout(\n", " title='Sub Scenes !',\n", ")\n", "\n", "fig = Figure(data=data, layout=layout)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "py.plot(fig, filename='subscenes')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 5, "text": [ "u'https://plot.ly/~etpinard/567'" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "To learn more about Plotly's Python API" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Refer to\n", "\n", "* our online documentation page or\n", "* our User Guide." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", "
\n", "\n", "

Got Questions or Feedback?

\n", "\n", "About Plotly\n", "\n", "* email: feedback@plot.ly \n", "* tweet: \n", "@plotlygraphs\n", "\n", "

Notebook styling ideas

\n", "\n", "Big thanks to\n", "\n", "* Cam Davidson-Pilon\n", "* Lorena A. Barba\n", "\n", "
" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.display import display, HTML\n", "import urllib2\n", "url = 'https://raw.githubusercontent.com/plotly/python-user-guide/master/custom.css'\n", "display(HTML(urllib2.urlopen(url).read()))" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", "\n" ], "metadata": {}, "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 6 } ], "metadata": {} } ] }