title: Legend based on edge color in networkx
body: <p>Is there a way to create a legend in networkx based on edge color (as opposed to by node color)?</p>
  
  <p>This is my graph:</p>
  
  <pre><code>plt.figure(figsize = (15, 10))
  G = nx.from_pandas_dataframe(df, 'From', 'To', ['Order', 'Colors'])
  edge_labels = nx.get_edge_attributes(G, 'Order')
  nx.draw_networkx(G, with_labels = False, node_color = 'black', alpha = 0.5, node_size = 3, linewidths = 1, edge_color = df['Colors'], edge_cmap = 
  plt.cm.Set2)
  plt.show()
  </code></pre>
  
  <p>In this, <code>['Order']</code> is a descriptor of the edge and <code>['Color']</code> is a unique integer mapped to each value in <code>['Order']</code>, which is working to create the edge colors based on the Set2 colormap.</p>
  
  <p>I can get the edge labels with something like:
      <code>edge_labels = nx.get_edge_attributes(G, 'Order')</code>
  but how do I put this into a legend?</p>
  
  <p>I'm happy to share the data and complete code if helpful!</p>