title: Matplotlib - stackplot, ufunc 'isfinite' not supported for the input types
body: <p>i am trying to make a plot following <a href="https://matplotlib.org/stable/gallery/lines_bars_and_markers/stackplot_demo.html#sphx-glr-gallery-lines-bars-and-markers-stackplot-demo-py" rel="nofollow noreferrer">this example</a>, for stackplots. And I'm getting this error:
  i got this error:</p>
  <pre><code>/usr/local/lib/python3.7/dist-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
    return array(a, dtype, copy=False, order=order, subok=True)
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-16-a4f62b79cc89&gt; in &lt;module&gt;()
        4 fig, ax = plt.subplots()
        5 ax.stackplot(rewards, means.values(),
  ----&gt; 6              labels=means.keys() )
        7 ax.legend(loc='')
        8 ax.set_title('')
  
  4 frames
  /usr/local/lib/python3.7/dist-packages/numpy/ma/core.py in masked_invalid(a, copy)
     2369         cls = type(a)
     2370     else:
  -&gt; 2371         condition = ~(np.isfinite(a))
     2372         cls = MaskedArray
     2373     result = a.view(cls)
  
  TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
  </code></pre>
  <p>I am using these values:</p>
  <pre><code>means = {'Ace Ventura: Pet Detective (1994)': array([ 26., 111.,  25., ...,  64.,  97., 176.]),
   'Anger Management (2003)': array([ 38., 114., 147., ...,  36.,  72., 146.]),
   'Batman Begins (2005)': array([ 32.,  71., 103., ..., 131., 164., 195.]),
   'Benny &amp; Joon (1993)': array([  5.,  47.,  81., ...,  80., 117., 202.]),
   'Brady Bunch Movie, The (1995)': array([ 13., 111., 141., ...,  88., 123., 204.]),
   'Conspiracy Theory (1997)': array([ 35., 113., 145., ..., 113., 145., 179.]),
   'Doctor Zhivago (1965)': array([  2.,  44.,  80., ...,  77., 115., 201.]),
   'Ed Wood (1994)': array([ 16.,  57.,  90., ...,  91., 125., 205.]),
   'Entrapment (1999)': array([ 12.,  54.,  87., ...,  52., 138., 171.]),
   'Escape from L.A. (1996)': array([ 39.,  76., 106., ...,  73., 104., 135.]),
   'Face/Off (1997)': array([ 40.,  77., 107., ...,  73., 147., 180.]),
   'Field of Dreams (1989)': array([ 23.,  64.,  96., ..., 128., 161., 194.])...}
  
  rewards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... 224, 225, 226, 227, 228, 229, 230]
  </code></pre>
  <p>but when I run this code:</p>
  <pre><code>fig, ax = plt.subplots()
  ax.stackplot(rewards, means.values(),
               labels=means.keys() )
  ax.legend(loc='')
  ax.set_title('')
  ax.set_xlabel('')
  ax.set_ylabel('')
  
  plt.show()
  </code></pre>
  <p>I can't see whats wrong since my code is basically the same thing that is in the link.</p>