title: Python: Data limit in Plotly frames?
body: <p>I have recently started to use Plotly to make 3D plots in python and I wanted to create an animation of what is going on in terms of column vectos of a 3 by 3 matrix when applying Gaussain elimination.
  I wrote a function to get the row echelon form and the history of the matrix obtained at each step.
  Then I wanted to plot the comuns vectors at each step of the algorithm.
  At first I was able to get an animation of the the evolution of the three vectors by adpating this code : <a href="https://plotly.com/python/visualizing-mri-volume-slices/" rel="nofollow noreferrer">https://plotly.com/python/visualizing-mri-volume-slices/</a>
  But then I wanted to show on each frame the three row vectors of a given step and the three row vectors from the matrix of the previous step with opacity 0.2.
  And when I added that part of the code I got a strange behavior from Plotly. It only showed me the three first vectors which are given to the frame and not all of them.</p>
  <p>Here the code I have so far :</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import numpy.linalg as la
  import plotly.graph_objects as go
  
  v1 = np.array([5,2,1])
  v2 = np.array([2,3,2])
  v3 = np.array([3,-1,1])
  
  A = np.transpose(np.vstack([v1,v2,v3]))
  # G, H = pivot_Gauss(A)
  H = [np.array([[ 5,  2,  3],[ 2,  3, -1],[ 1,  2,  1]]), np.array([[ 1,  0,  0],[ 2,  3, -1],[ 1,  2,  1]]),
      np.array([[ 1,  0,  0],[ 0,  3, -1],[ 1,  2,  1]]), np.array([[ 1,  0,  0],[ 0,  3, -1],[ 0,  2,  1]]), 
      np.array([[1, 0, 0],[0, 1, 0],[0, 2, 1]]), np.array([[1, 0, 0],[0, 1, 0],[0, 0, 1]]), 
      np.array([[1, 0, 0],[0, 1, 0],[0, 0, 1]]) ]
  
  G = np.array([[1,0,0],[0,1,0],[0,0,1]]) # results obtained using the function pivot_Gauss(A)
  
  nb_frames = len(H)
  
  frames = []
  v_norm = 5
  colors = [&quot;blue&quot;,&quot;red&quot;,&quot;green&quot;]
  for k in range(nb_frames): # go.Frame(data,name=str(k))
     dat = []
     for j in range(np.shape(A)[1]):
         v = H[k][:,j]
         if la.norm(v) != 0 :
             d1 = go.Scatter3d( x=[0,v[0]],y=[0,v[1]],z=[0,v[2]],name=&quot;v&quot;+str(k+j+1),hoverinfo='name',
                                                marker=dict(size=0), line=dict(color=colors[j], width=10 ))
             dat.append(d1)
             d2 = go.Cone(x=[v[0]],y=[v[1]],z=[v[2]],
                              u=[v[0]/v_norm],v=[v[1]/v_norm],w=[v[2]/v_norm],sizeref=1,
                              sizemode=&quot;scaled&quot;,anchor=&quot;cm&quot;,name=&quot;v&quot;+str(k+j+1),hoverinfo='x+y+z+name',
                              colorscale=[[0, colors[j]], [1,colors[j]]],showscale=False)
             dat.append(d2)
         if k&gt;0 : # add column vectors of previous Gaussain elimination step (causes some troubles, 
  #if this if section is commented I get an animation of the three clumn vectors of current step)
             vk = H[k-1][:,j]
             if la.norm(v) != 0 :
                 d3 =  go.Scatter3d( x=[0,vk[0]],y=[0,vk[1]],z=[0,vk[2]],name=&quot;v&quot;+str(k+j+1),hoverinfo='name',
                                                    marker=dict(size=0), line=dict(color=colors[j], width=10), opacity = 0.2 )
                 dat.append(d3)
                 d4 = go.Cone(x=[vk[0]],y=[vk[1]],z=[vk[2]],
                                  u=[vk[0]/v_norm],v=[vk[1]/v_norm],w=[vk[2]/v_norm],sizeref=1,
                                  sizemode=&quot;scaled&quot;,anchor=&quot;cm&quot;,name=&quot;v&quot;+str(k+j+1),hoverinfo='x+y+z+name',
                                  colorscale=[[0, colors[j]], [1,colors[j]]],showscale=False,opacity=0.2)
                 dat.append(d4)
     frames.append(go.Frame(data=dat,name=str(k)))
     
  
  fig = go.Figure(frames=frames)
  # Add data to be displayed before animation starts
  for j in range(A.shape[1]):
     v = A[:,j]
     if la.norm(v) != 0 :
         fig.add_trace( go.Scatter3d( x=[0,v[0]],y=[0,v[1]],z=[0,v[2]],name=&quot;v&quot;+str(k+1),hoverinfo='name',
                                            marker=dict(size=0), line=dict(color=colors[j], width=10 ))  )
         fig.add_trace( go.Cone(x=[v[0]],y=[v[1]],z=[v[2]],
                          u=[v[0]/v_norm],v=[v[1]/v_norm],w=[v[2]/v_norm],sizeref=1,
                          sizemode=&quot;scaled&quot;,anchor=&quot;cm&quot;,name=&quot;v&quot;+str(k+1),hoverinfo='x+y+z+name',
                          colorscale=[[0, colors[j]], [1,colors[j]]],showscale=False) )
  
  ### This remained almost exactly as the Plotly example  
  def frame_args(duration):
     return {
             &quot;frame&quot;: {&quot;duration&quot;: duration},
             &quot;mode&quot;: &quot;immediate&quot;,
             &quot;fromcurrent&quot;: True,
             &quot;transition&quot;: {&quot;duration&quot;: duration, &quot;easing&quot;: &quot;linear&quot;},
         }
  
  sliders = [
             {
                 &quot;pad&quot;: {&quot;b&quot;: 10, &quot;t&quot;: 60},
                 &quot;len&quot;: 0.9,
                 &quot;x&quot;: 0.1,
                 &quot;y&quot;: 0,
                 &quot;steps&quot;: [
                     {
                         &quot;args&quot;: [[f.name], frame_args(0)],
                         &quot;label&quot;: str(k),
                         &quot;method&quot;: &quot;animate&quot;,
                     }
                     for k, f in enumerate(fig.frames)
                 ],
             }
         ]
  
  matrix_but = [
              {&quot;buttons: [{},{},{},{},{},{}]&quot;}
                 ]
  
  # Layout
  fig.update_layout(
          title='Pivot de Gauss',
          width=600,
          height=400,
          scene=dict(xaxis=dict(autorange=True),
                     yaxis=dict(autorange=True),
                     zaxis=dict(autorange=True),
                     aspectratio=dict(x=1, y=1, z=1),
                     ),
          updatemenus = [
             {
                 &quot;buttons&quot;: [
                     {
                         &quot;args&quot;: [None, frame_args(200)],
                         &quot;label&quot;: &quot;&amp;#9654;&quot;, # play symbol
                         &quot;method&quot;: &quot;animate&quot;,
                     },
                     {
                         &quot;args&quot;: [[None], frame_args(0)],
                         &quot;label&quot;: &quot;&amp;#9724;&quot;, # pause symbol
                         &quot;method&quot;: &quot;animate&quot;,
                     },
                 ],
                 &quot;direction&quot;: &quot;left&quot;,
                 &quot;pad&quot;: {&quot;r&quot;: 10, &quot;t&quot;: 70},
                 &quot;type&quot;: &quot;buttons&quot;,
                 &quot;x&quot;: 0.1,
                 &quot;y&quot;: 0,
             }
          ],
          sliders=sliders
  )
  
  fig.show()
  </code></pre>
  <p>You will notice that for each vector I first draw a 3D line and then use cone to get the it arrow_shaped. It might not be the best way to do it, but I do not want to use cone alone as the apsect does not fit what I would like.
  I stumbled across a (I think) similar question here : <a href="https://community.plotly.com/t/only-one-trace-showing-per-frame-in-animated-plot/25803" rel="nofollow noreferrer">https://community.plotly.com/t/only-one-trace-showing-per-frame-in-animated-plot/25803</a>
  But I did not undestand the answer nor the example.
  It seems from what I get that only the first six elemetns of the data contained in each frame is taken into account, but I do not understand why and I would like to show everything.
  If someone has some insight (and a solution) on the subject, it would be warmly welcomed.
  I can clarify things if needed.</p>
  <p><a href="https://i.stack.imgur.com/hXdEI.png" rel="nofollow noreferrer">Image of the two first column vectors of matrix from current step and first column vector of matrix from previous step</a></p>
  <p><a href="https://i.stack.imgur.com/i2arP.png" rel="nofollow noreferrer">Image of the three column vectors of current matrix when part below if k&gt;0 is commented</a></p>