title: custom ordered mapping of string labels to colors in matplotlib
body: <p>I have 2D data with string labels in a dataframe:</p>
  <pre><code>df = pd.DataFrame(data, columns = ['dim1', 'dim2', 'label'])
  </code></pre>
  <p>The labels are strings that have an ordering e.g 'small', 'small-medium, 'medium', 'medium-big', 'big' (simplified for the purposes of the question).</p>
  <p>I would like to plot my data on a scatterplot in such a way so that the colors reflect the ordering (so I'm going to use  to a perceptually uniform sequential colormap).</p>
  <p>Currently, here's what I have, which just plots the datapoints and colors them based on their labels:</p>
  <pre><code>groups = df.groupby('label')
  
  fig = plt.figure(figsize=[20, 20])
  ax = fig.add_subplot(111)
  
  for name, group in groups:
      ax.plot(group.dim1, group.dim2, label=name, marker='o', linestyle='', markersize=12)
  ax.legend(fontsize=20)
  </code></pre>
  <p>How can I adjust the code so that it does what I want?</p>