{
"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": [
"