Map data points to colormap with seaborn.swarmplot
<p>I would like to generate a seaborn.swarmplot, in which the color of single datapoints is mapped to a color map.</p>

<p>I have a DataFrame similar to this:</p>

<pre><code>In[48]:df
Out[48]: 
      a  c   Key
   0  1  12  1st
   1  4  35  2nd
   2  5  12  2nd
   3  6  46  1st
   4  3  78  1st
   5  4  45  2nd
   6  5  34  1st
   7  6  70  2nd
</code></pre>

<p>I generate a swarmplot with the following code:</p>

<pre><code>sns.swarmplot(x='Key', y = 'a',  s=20, data = df)
</code></pre>

<p>And get a plot like this:</p>

<p><a href="https://i.stack.imgur.com/U4h3V.png" rel="nofollow noreferrer">Swarmplot</a></p>

<p>Now, I would like the datapoints to map to a colormap, which would represent the values according to column 'c' of the DataFrame. </p>

<p>I tried to add 'hue = 'c' to the code and get the following:</p>

<pre><code>sns.swarmplot(x='Key', y = 'a',  hue='c',s=20, data = df)
</code></pre>

<p><a href="https://i.stack.imgur.com/HFhjX.png" rel="nofollow noreferrer">Swarmplot with 'hue'</a></p>

<p>This kind of goes into the direction I want it, but I'd much rather prefer to have the color map to a color map, so that low 'c' values would for example be light-green and the higher the 'c' value get the darker the green gets. </p>

<p>As a legend I would like to have a gradient. </p>

<p>Help would be much appreciated!!!</p>