title: How to change colormap in joypy plot?
body: <p>I have a dataframe which looks like this:</p>
  <pre><code>  Team  Minute  Type
     148      12     1
     148      22     1
     143      27     1
     148      29     1
     143      32     1
     143      32     1
  </code></pre>
  <p>I created a joyplot using the Python library <a href="https://github.com/sbebo/joypy" rel="nofollow noreferrer">joypy</a></p>
  <pre><code>fig, axes = joypy.joyplot(df, by=&quot;Team&quot;, column=&quot;Minute&quot;, figsize =(10,16), x_range = [0,94], linewidth = 1, colormap=plt.cm.viridis)
  </code></pre>
  <p>Which gave me this plot:</p>
  <p><a href="https://i.stack.imgur.com/Nkwwq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nkwwq.png" alt="enter image description here" /></a></p>
  <p>All Good.
  However, the colourmap is meaningless now so I am trying to color the plots according to a second dataframe - which is the sum of <code>Type</code> for all the teams.</p>
  <p>To do that, I created a norm, and a colourmap using these lines:</p>
  <pre><code>norm = plt.Normalize(group_df[&quot;Type&quot;].min(), group_df[&quot;Type&quot;].max())
  cmap = plt.cm.viridis
  sm = matplotlib.cm.ScalarMappable(cmap=cmap, norm=norm)
  ar = np.array(group_df[&quot;Type&quot;])
  Cm = cmap(norm(ar))
  sm.set_array([])
  </code></pre>
  <p>Here's where the problem arose as I can't figure out how to change the color of the joyplots. I tried a couple of approaches:</p>
  <ol>
  <li><p>I tried to pass this <code>Cm</code> as the colormap argument. However, that threw up an error - <code>typeerror 'numpy.ndarray' object is not callable</code></p>
  </li>
  <li><p>I tried to use a for loop over the <code>axes</code> and <code>Cm</code> -</p>
  </li>
  </ol>
  <pre><code>for col, ax in zip(Cm, axes):
      ax.set_facecolor(col)
      #ax.patch.set_facecolor(col) ##Also tried this; didn't change anything
  </code></pre>
  <p>How can I get greater control over the colours of the joyplot and change them around? Any help would be appreciated.</p>
  <h2><strong>MCVE</strong></h2>
  <p>Sample of the csv file I'm reading in(Actual shape of dataframe is (4453,2)):</p>
  <pre><code>      Team  Minute
  0      148       5
  1      148       5
  2      148      11
  3      148      11
  4      148      12
  5      148      22
  6      143      27
  </code></pre>
  <p>My code:</p>
  <pre><code>df = pd.read_csv(r&quot;path&quot;)
  
  ##getting the sum for every team - total of 20 teams
  group_df = df.groupby([&quot;Team&quot;]).size().to_frame(&quot;Count&quot;).reset_index()
    
  df[&quot;Minute&quot;] = pd.to_numeric(df[&quot;Minute&quot;])
  
  ##Trying to create a colormap 
  norm = plt.Normalize(group_df[&quot;Count&quot;].min(), group_df[&quot;Count&quot;].max())
  cmap = plt.cm.viridis
  sm = matplotlib.cm.ScalarMappable(cmap=cmap, norm=norm)
  ar = np.array(group_df[&quot;Count&quot;])
  Cm = cmap(norm(ar))
  sm.set_array([])
  
  
  fig, axes = joypy.joyplot(df, by=&quot;Team&quot;, column=&quot;Minute&quot;, figsize =(10,16), x_range = [0,94], colormap = plt.cm.viridis)
  </code></pre>
  <p>I want to color every subplot in the plot by the total count of the team from the <code>group_df[&quot;Count&quot;]</code> values. Currently, the colormap is just uniform and not according to the total value. The picture above is what's produced.</p>