I am working on Jupyter notebook, and I am trying to create a wrapper function for the regular Plotly Scatter3d() function, with my own layout settings, so that I can call this directly every time I need to plot something, and save screen space.
BUT, this is not working. Nothing is getting displayed on the screen. Does anyone know why?
My code:
def BSplot3dPlotly(xyz):
xyz = np.reshape(xyz, (int(xyz.size/3), 3))
trace1 = go.Scatter3d(
x=xyz[:,0],
y=xyz[:,1],
z=xyz[:,2],
mode = 'markers', # lines+markers',
#marker=Marker(color=Y, colorscale='Portland')
marker=dict(
size=12,
line=dict(
color='rgba(217, 217, 217, 0.14)',
width=0.5
),
opacity=0.8
)
)
data = go.Data([trace1]) #[trace1]
layout = go.Layout(
margin=dict(
l=0,
r=0,
b=0,
t=0
)
)
fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename=name)
Here the imput xyzis just a list containing x,y,z coordinates for some points.

import, and how ispydefined. Are you using offline plot?