title: Create colormap from dictionary
body: <p>Am using <code>geopandas</code> to plot a map with categorical colors. <code>geopandas</code> is an interface to <code>matplotlib</code> so the same structures should work. What I'm after is to have each <code>key</code> display in a specific color. Random color from a predefined cm is fine, as long as the <code>No data</code> can be made grey.</p>
  
  <pre><code>keys = ['A', 'B', 'C', 'D', 'No data']
  color_range = list(np.linspace(0, 1, len(keys), endpoint=False))
  colors = [plt.cm.Pastel1(x) for x in color_range]
  color_dict = dict(zip(keys, colors))
  color_dict['No data'] = 'lightgrey'
  </code></pre>
  
  <p>The dictionary I get from this looks correct:</p>
  
  <pre><code>{'A': (0.98, 0.70, 0.68, 1.0), 
  'B': (0.70, 0.80, 0.89, 1.0), 
  'C': (0.87, 0.79, 0.89, 1.0), 
  'D': (1.0, 1.0, 0.8, 1.0), 
  'No data': 'lightgrey'}
  </code></pre>
  
  <p>When I try to convert it to a colormap, I get a KeyError: 0</p>
  
  <pre><code>cmap = LinearSegmentedColormap.from_list('mycmap', color_dict)
  </code></pre>
  
  <p>My final plot command is:</p>
  
  <pre><code>merged_df.plot(column='GROUP', categorical=True, legend=True, cmap=cmap)
  </code></pre>