title: How to assign different colors to different edges using igraph in Python?
body: <p>I have a graph with three kinds of edges: 'company', 'std' and 'res'. Many other vertices have no edges. </p>
  
  <p>When I plot a summary, I get:</p>
  
  <pre><code>IGRAPH UN-- 500 36 -- 
  + attr: area (v), cnpj (v), grande_area (v), name (v), res (v), std (v), company (e), res (e), std (e)
  </code></pre>
  
  <p>I want to plot the different kinds of edges in different colors, but I cannot find the right code. </p>
  
  <p>Here is a sample of what I get when I print the edges:</p>
  
  <pre><code>igraph.Edge(&lt;igraph.Graph object at 0x00000000045A4B88&gt;, 7, {'res': True, 'company': None, 'std': None})
  igraph.Edge(&lt;igraph.Graph object at 0x00000000045A4B88&gt;, 8, {'res': True, 'company': None, 'std': None})
  igraph.Edge(&lt;igraph.Graph object at 0x00000000045A4B88&gt;, 9, {'res': True, 'company': None, 'std': None})
  igraph.Edge(&lt;igraph.Graph object at 0x00000000045A4B88&gt;, 10, {'res': None, 'company': True, 'std': None})
  igraph.Edge(&lt;igraph.Graph object at 0x00000000045A4B88&gt;, 11, {'res': True, 'company': None, 'std': None})
  igraph.Edge(&lt;igraph.Graph object at 0x00000000045A4B88&gt;, 12, {'res': None, 'company': True, 'std': None})
  </code></pre>
  
  <p>The code I used to make the edges is:</p>
  
  <pre><code>def edge_group(g):
      for v in g.vs:
          for w in g.vs:
              if v != w:
                  if g.are_connected(v, w) is False:
                      if v['name'].get_cnpj() != "":
                          if v["name"].get_cnpj() == w["name"].get_cnpj():
                              g.add_edge(v, w, company=True)
                      if len(set(v['std']).intersection(w['std'])) &gt; 0:
                          g.add_edge(v, w, std=True)
                      if len(set(v['res']).intersection(w['res'])) &gt; 0:
                          g.add_edge(v, w, res=True)
      return g
  </code></pre>
  
  <p>And here is the code that is giving me all edges 'black'</p>
  
  <pre><code>def drawing_group(g):
      layout = g.layout("fr")
      visual_style = {}
      visual_style["vertex_size"] = 1
      if g.es["company"] is True and g.es['res'] is True and g.es['std'] is True:
          visual_style['edge_color'] = 'black'
      if g.es["company"] is True and g.es['res'] is True:
          visual_style['edge_color'] = 'grey'
      if g.es["company"] is True and g.es['std'] is True:
          visual_style['edge_color'] = 'green'
      if g.es['company'] is True:
          visual_style['edge_color'] = 'blue'
      if g.es['res'] is True and g.es['std'] is True:
          visual_style['edge_color'] = 'red'
      if g.es['res'] is True:
          visual_style['edge_color'] = 'yellow'
      if g.es['std'] is True:
          visual_style['edge_color'] = 'brown'
      visual_style["layout"] = layout
      visual_style["bbox"] = (500, 500)
      visual_style["margin"] = 20
      visual_style['hovermode'] = 'closest'
  
      igraph.plot(g, 'output/gr_%s.png' % num, **visual_style)
  </code></pre>
  
  <p>Thanks in advance.</p>