In [4]:
import numpy as np
from plotly.offline import download_plotlyjs, init_notebook_mode,  iplot, plot
init_notebook_mode(connected=True)
In [6]:
y=np.linspace(0,6*np.pi,200)
x=np.zeros(len(y))#([i*2, i*2+1])
z=np.sin(y)

traces=[dict(
            z=[[cz,cz] for cz in z],
            x=[[cx,cx+1] for cx in x],
            y=[[cy,cy] for cy in y],
colorscale=[ [i, 'rgb(100,100,255)'] for i in [0, 0.5, 1.0] ],
showscale=False,
type='surface',
)]

malpha=np.linspace(0,90,5)
malpha=[float(xx)/180*np.pi for xx in malpha]

mfr=[]
for ii in malpha:
    mcam= dict(up=dict(x=-np.sin(ii), y=0, z=np.cos(ii)),
               center=dict(x=0, y=0, z=0),
               eye=dict(x=2.5*np.cos(ii), y=0, z=2.5*np.sin(ii)),
              )
    mfr.append(dict(#data=traces,
                   layout= dict(scene=dict(camera=dict(up=dict(x=-np.sin(ii), y=0, z=np.cos(ii)),
                                                        center=dict(x=0, y=0, z=0),
                                                        eye=dict(x=2.5*np.cos(ii), y=0, z=2.5*np.sin(ii)),
                                                        )
                                           ),
                                 title=('Cur angle:'+str(ii/3.1415*180))
                                )
                   )
              )




layout=dict(width=600, height=600, title='Ribbon plot',
            scene=dict(camera=dict(up=dict(x=0, y=0, z=1),
                                   center=dict(x=0, y=0, z=0),
                                   eye=dict(x=2.5, y=0, z=0)
                                  )
                      ),
            updatemenus=[dict(type='buttons', showactive=False,
                                y=1,
                                x=1.55,
                                xanchor='right',
                                yanchor='top',
                                pad=dict(t=0, r=10),
                                buttons=[dict(
                                label='Play',
                                method='animate',
                                args=[None, dict(frame=dict(duration=100, redraw=True), 
                                                 transition=dict(duration=0),
                                                 fromcurrent=True,
                                                 mode='immediate'
                                                )
                                     ]
                                             )
                                        ]
                               )
                          ]     
           )
          
fig=dict(data=traces, layout=layout, frames=mfr)

iplot(fig,filename='ribbon-plot-python2')
In [ ]: