title: How to change colours of nodes and edges of bipartite graph in networkX?
body: <p>I use this piece of code to draw a bipartite graph using <strong>networkX</strong>:</p>
  
  <pre><code>import networkx as nx
  
  G = bipartite.from_biadjacency_matrix(a_matrix, create_using=None, edge_attribute='weight')
  X, Y = bipartite.sets(G)
  pos = dict()
  pos.update((n, (0, i*10)) for i, n in enumerate(X))
  pos.update((n, (0.5, i*10)) for i, n in enumerate(Y))
  nx.draw(G, pos=pos)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wqCSK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wqCSK.jpg" alt="enter image description here"></a></p>
  
  <p>Is there a way to randomly change colours of different sets of <strong>nodes</strong> and <strong>edges</strong> between them?</p>