title: ValueError: Points must be Nx2 array, got 2x5
body: <p>I'm trying to make an animation and am looking at the code of another stack overflow <a href="https://stackoverflow.com/questions/44610210/how-to-animate-scatter-plot-over-time-using-python">question</a>. The code is the following</p>
  <pre><code>import matplotlib.pyplot as plt
  from matplotlib import animation as animation
  import numpy as np
  import pandas as pd
  import io
  
  u = u&quot;&quot;&quot;Time    M1  M2  M3  M4  M5
  1       1   2   3   1   2
  2       1   3   3   1   2
  3       1   3   2   1   3
  4       2   2   3   1   2
  5       3   3   3   1   3
  6       2   3   4   1   4
  7       2   3   4   3   3
  8       3   4   4   3   4
  9       4   4   5   3   3
  10      4   4   5   5   4&quot;&quot;&quot;
  
  df_Bubble = pd.read_csv(io.StringIO(u), delim_whitespace=True)
  
  time_count = len(df_Bubble) 
  colors = np.arange(1, 6) 
  x = np.arange(1, 6) 
  max_radius = 25 
  fig, ax = plt.subplots() 
  pic = ax.scatter(x, df_Bubble.iloc[0, 1:], s=100, c=colors) 
  pic.set_offsets([[np.nan]*len(colors)]*2)
  ax.axis([0,7,0,7])
  
  def init(): 
      pic.set_offsets([[np.nan]*len(colors)]*2)
      return pic,
  
  def updateData(i): 
      y = df_Bubble.iloc[i, 1:] 
      area = np.pi * (max_radius * y / 10.0) ** 2 
      pic.set_offsets([x, y.values]) 
      pic._sizes = area
      i+=1 
      return pic, 
  
  ani = animation.FuncAnimation(fig, updateData, 
        frames=10, interval = 50, blit=True, init_func=init) 
  
  plt.show()
  </code></pre>
  <p>When I run this code unchanged I get the error</p>
  <pre><code>ValueError: Points must be Nx2 array, got 2x5
  </code></pre>
  <p>I have looked at similar threads on this question and have come to the conclusion that the problem has to do with the line with [[np.nan]*len(colors)]*2. Based on the examples I found, I thought that changing a part of this line to an array might help, but none of my attempts have worked, and now I'm stuck. I would be grateful for any help.</p>