Plotly 3d sub-scenes



In [1]:
import plotly
plotly.__version__
Out[1]:
'1.4.7'
In [2]:
import plotly.plotly as py  # sign in with your credentials file
import plotly.tools as tls
from plotly.graph_objs import *
In [3]:
import numpy as np
def get_random_data(N):
    return np.random.random(N), np.random.random(N), np.random.random(N)
In [4]:
N = 40

x1, y1, z1 = get_random_data(N)
trace1 = Scatter3d(
    x=x1,
    y=y1,
    z=z1,
    mode='markers',
    scene='scene1'
)

x2, y2, z2 = get_random_data(N)
trace2 = Scatter3d(
    x=x2,
    y=y2,
    z=z2,
    mode='markers',
    scene='scene2'
)

data = Data([trace1, trace2])

layout = Layout(
    title='Sub Scenes !',
)

fig = Figure(data=data, layout=layout)
In [5]:
py.plot(fig, filename='subscenes')
Out[5]:
u'https://plot.ly/~etpinard/567'


To learn more about Plotly's Python API

Refer to

Got Questions or Feedback?

About Plotly

Notebook styling ideas

Big thanks to


In [6]:
from IPython.display import display, HTML
import urllib2
url = 'https://raw.githubusercontent.com/plotly/python-user-guide/master/custom.css'
display(HTML(urllib2.urlopen(url).read()))