I have a list of sub-graphs and I want print it in one picture, I added all the nodes in the graph G, but I want to keep information of my sub-graphs, so I have give one color to each node and when a node belong of 2 sub-graphs, it has 2 colors (3 is belong 3, 4 to 4, ...).
My problem is to show the nodes with all of theirs colors parts and their labels in one picture, of course at the wright positions. I want to add a background in the picture too, and this picture doesn't appear in the same plot, but I would show it in the same plot.
plt.figure(figsize=(22,18))
plt.imshow(background, origin='lower', cmap="binary", alpha=0.5)
nodes = nx.draw_networkx_nodes(G, pos=posi)
nx.draw_networkx_labels(G, pos=posi)
for node in G.nodes() :
plt.pie([1]*pgm, center=posi[node], colors = [cmap(a) for a in colors[node]])
plt.show()
plt.close()
I was inspired by Creating piechart as nodes in Networkx.
Do you know how can I give different colors to a same node and print theirs labels, and the background in the same picture ?


